File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
src/typed_diskcache/implement/sync Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -252,6 +252,12 @@ def release(self) -> None:
252252class AsyncLock (AsyncLockProtocol ):
253253 """Lock implementation using spin-lock algorithm.
254254
255+ !!! warning
256+ If the current Python interpreter is free-threading (without GIL),
257+ using [`AsyncLock`][typed_diskcache.AsyncLock] may lead to unexpected
258+ behavior. Consider using [`SyncLock`][typed_diskcache.SyncLock]
259+ instead in such cases.
260+
255261 Assumes the key will not be evicted. Set the eviction policy to 'none' on
256262 the cache to guarantee the key is not evicted.
257263
@@ -376,6 +382,12 @@ async def __aexit__(
376382class AsyncRLock (AsyncLock ):
377383 """Re-entrant lock implementation using spin-lock algorithm.
378384
385+ !!! warning
386+ If the current Python interpreter is free-threading (without GIL),
387+ using [`AsyncRLock`][typed_diskcache.AsyncRLock] may lead to unexpected
388+ behavior. Consider using [`SyncRLock`][typed_diskcache.SyncRLock]
389+ instead in such cases.
390+
379391 Assumes the key will not be evicted. Set the eviction policy to 'none' on
380392 the cache to guarantee the key is not evicted.
381393
Original file line number Diff line number Diff line change @@ -179,6 +179,12 @@ def __exit__(
179179class AsyncSemaphore (AsyncSemaphoreProtocol ):
180180 """Asynchronous semaphore implementation using spin-lock algorithm.
181181
182+ !!! warning
183+ If the current Python interpreter is free-threading (without GIL),
184+ using [`AsyncSemaphore`][typed_diskcache.AsyncSemaphore] may lead to unexpected
185+ behavior. Consider using [`SyncSemaphore`][typed_diskcache.SyncSemaphore]
186+ instead in such cases.
187+
182188 Assumes the key will not be evicted. Set the eviction policy to 'none' on
183189 the cache to guarantee the key is not evicted.
184190
You can’t perform that action at this time.
0 commit comments