MCPcopy Create free account
hub / github.com/tox-dev/filelock / _deadlock_scope

Method _deadlock_scope

src/filelock/asyncio.py:129–134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127
128 @staticmethod
129 def _deadlock_scope() -> Hashable | None:
130 # One event loop thread runs every task, so a thread-scoped registry cannot tell a same-task reacquire
131 # (a real deadlock: the polling task never reaches its own release) from another task queuing behind the
132 # holder (no deadlock: each poll yields, so the holder runs on and releases). Only the first may fail
133 # fast, so scope holders to the task.
134 return asyncio.current_task()
135
136 def __init__( # ruff:ignore[too-many-arguments] # public constructor: one parameter per documented lock option
137 self,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected