| 139 | init_calls = 0 |
| 140 | |
| 141 | class CustomLock(SoftReadWriteLock): |
| 142 | def __init__(self, *args: Any, **kwargs: Any) -> None: # ruff:ignore[any-type] # forwards the public constructor unchanged |
| 143 | nonlocal init_calls |
| 144 | init_calls += 1 |
| 145 | super().__init__(*args, **kwargs) |
| 146 | |
| 147 | def construct() -> SoftReadWriteLock: |
| 148 | callers.wait(timeout=5) |