(lock: AsyncReadWriteLock)
| 29 | |
| 30 | |
| 31 | async def can_write(lock: AsyncReadWriteLock) -> bool: |
| 32 | try: |
| 33 | await lock.acquire_write(blocking=False) |
| 34 | except Timeout: |
| 35 | return False |
| 36 | await lock.release() |
| 37 | return True |
| 38 | |
| 39 | |
| 40 | async def write_once(lock: AsyncReadWriteLock) -> None: |