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

Function gated

tests/test_read_write_unit.py:670–674  ·  view source on GitHub ↗
(*, blocking: bool, timeout: float)

Source from the content-addressed store, hash-verified

668 errors: dict[str, RuntimeError] = {}
669
670 def gated(*, blocking: bool, timeout: float) -> None:
671 if threading.get_ident() == writer_tid.get("id"): # writer has passed its early check at lock_level == 0
672 writer_at_gate.set()
673 reader_acquired.wait(5) # let the reader fully acquire (and open its transaction) first
674 real_acquire_tx(blocking=blocking, timeout=timeout)
675
676 def acquire_write_in_thread() -> None:
677 writer_tid["id"] = threading.get_ident()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…