MCPcopy Index your code
hub / github.com/python/cpython / has_deadlock

Method has_deadlock

Lib/importlib/_bootstrap.py:288–302  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

286 self.waiters = []
287
288 def has_deadlock(self):
289 # To avoid deadlocks for concurrent or re-entrant circular imports,
290 # look at _blocking_on to see if any threads are blocking
291 # on getting the import lock for any module for which the import lock
292 # is held by this thread.
293 return _has_deadlocked(
294 # Try to find this thread.
295 target_id=_thread.get_ident(),
296 seen_ids=set(),
297 # Start from the thread that holds the import lock for this
298 # module.
299 candidate_ids=[self.owner],
300 # Use the global "blocking on" state.
301 blocking_on=_blocking_on,
302 )
303
304 def acquire(self):
305 """

Callers 1

acquireMethod · 0.95

Calls 2

_has_deadlockedFunction · 0.85
setFunction · 0.85

Tested by

no test coverage detected