()
| 57 | both_inside = asyncio.Event() |
| 58 | |
| 59 | async def read() -> None: |
| 60 | nonlocal readers |
| 61 | async with lock.read_lock(timeout=TASK_WAIT): |
| 62 | readers += 1 |
| 63 | if readers == 2: |
| 64 | both_inside.set() |
| 65 | await asyncio.wait_for(both_inside.wait(), TASK_WAIT) |
| 66 | |
| 67 | await asyncio.gather(read(), read()) |
| 68 | await lock.close() |
no test coverage detected