filesystem_spec icon indicating copy to clipboard operation
filesystem_spec copied to clipboard

Thread safety of get_lock in asyn.py

Open ccotter opened this issue 9 months ago • 1 comments

https://github.com/fsspec/filesystem_spec/blob/master/fsspec/asyn.py#L27-L35

If _lock is None, if two threads both enter get_lock, both threads could see _lock is None, one thread could create a new Lock, return it to the caller, then the second thread could create a new Lock and return that different lock to the caller.

ccotter avatar Jan 28 '25 18:01 ccotter