Hold on to lock for a set amount of time before unlocking.
(to_unlock, delay)
| 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()) |