()
| 31 | inside = peak = 0 |
| 32 | |
| 33 | async def write() -> None: |
| 34 | nonlocal inside, peak |
| 35 | async with lock.write_lock(timeout=TASK_WAIT): |
| 36 | inside += 1 |
| 37 | peak = max(peak, inside) |
| 38 | await asyncio.sleep(0) |
| 39 | inside -= 1 |
| 40 | |
| 41 | await asyncio.gather(*(write() for _ in range(20))) |
| 42 | await lock.close() |
no test coverage detected