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

Function _write_intent_pending

tests/sqlite/test_lock_contention.py:213–221  ·  view source on GitHub ↗
(prober: ReadWriteLock, deadline: float)

Source from the content-addressed store, hash-verified

211
212
213def _write_intent_pending(prober: ReadWriteLock, deadline: float) -> bool:
214 try:
215 prober.acquire_read(blocking=False)
216 except Timeout:
217 return False
218 prober.release()
219 assert time.monotonic() < deadline, "Writer never registered its write intent"
220 time.sleep(0.05) # simplint: ignore[sleep-in-test] # needs a write-intent signal
221 return True
222
223
224@NEEDS_POSIX_SIGNALS # pragma: needs posix-signals

Calls 3

sleepMethod · 0.80
acquire_readMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected