| 53 | acquired = released = False |
| 54 | |
| 55 | class AioFileLock(BaseAsyncFileLock): |
| 56 | async def _acquire(self) -> None: # ty: ignore[incompatible-method-override] # coroutine backends are supported |
| 57 | nonlocal acquired |
| 58 | acquired = True |
| 59 | self._context.lock_file_fd = 1 |
| 60 | |
| 61 | async def _release(self) -> None: # ty: ignore[incompatible-method-override] # coroutine backends are supported |
| 62 | nonlocal released |
| 63 | released = True |
| 64 | self._context.lock_file_fd = None |
| 65 | |
| 66 | lock = AioFileLock(str(tmp_path / "a")) |
| 67 | await lock.acquire() |
no outgoing calls