(self, blocking: bool = True, timeout: float = -1)
| 2343 | self.release_count = 0 |
| 2344 | |
| 2345 | def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: |
| 2346 | acquired = self.lock.acquire(blocking=blocking, timeout=timeout) |
| 2347 | if acquired: |
| 2348 | # int.__iadd__ is atomic on GIL-enabld interpreters; when the GIL is |
| 2349 | # disabled things are nuanced and hardware-dependent. Don't risk it. |
| 2350 | self.acquire_count += 1 |
| 2351 | return acquired |
| 2352 | |
| 2353 | def release(self) -> None: |
| 2354 | if self.lock.locked(): |
no test coverage detected