(self)
| 168 | self.unlock = create_async_event() |
| 169 | |
| 170 | async def lock_pool(self): |
| 171 | async with self.pool.lock: |
| 172 | self.locked.set() |
| 173 | # Wait for the unlock flag. |
| 174 | unlock_pool = await self.wait(self.unlock, 10) |
| 175 | if not unlock_pool: |
| 176 | raise Exception("timed out waiting for unlock signal: deadlock?") |
| 177 | |
| 178 | async def wait(self, event: Event, timeout: int): |
| 179 | if _IS_SYNC: |