MCPcopy Index your code
hub / github.com/RustPython/RustPython / delay_unlock

Method delay_unlock

Lib/test/test_dummy_thread.py:67–70  ·  view source on GitHub ↗

Hold on to lock for a set amount of time before unlocking.

(to_unlock, delay)

Source from the content-addressed store, hash-verified

65 def test_uncond_acquire_blocking(self):
66 #Make sure that unconditional acquiring of a locked lock blocks.
67 def delay_unlock(to_unlock, delay):
68 """Hold on to lock for a set amount of time before unlocking."""
69 time.sleep(delay)
70 to_unlock.release()
71
72 self.lock.acquire()
73 start_time = int(time.monotonic())

Callers

nothing calls this directly

Calls 2

sleepMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected