Skip to content

Commit 0910f43

Browse files
committed
Fix #57
1 parent a03ffc0 commit 0910f43

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cachebox/_wrappers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ def __init__(self, lock: AbstractContextManager) -> None:
1919
def __enter__(self) -> None:
2020
self.waiters += 1
2121
self._lock.__enter__()
22+
self.waiters -= 1
2223

2324
def __exit__(self, *_) -> None:
24-
self.waiters -= 1
2525
self._lock.__exit__(*_)
2626

2727

@@ -35,9 +35,9 @@ def __init__(self, lock: AbstractAsyncContextManager) -> None:
3535
async def __aenter__(self) -> None:
3636
self.waiters += 1
3737
await self._lock.__aenter__()
38+
self.waiters -= 1
3839

3940
async def __aexit__(self, *_) -> None:
40-
self.waiters -= 1
4141
await self._lock.__aexit__(*_)
4242

4343

0 commit comments

Comments
 (0)