1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-05 18:30:50 +01:00

utils/misc: Use an RLock in tls_property

Allow reentrancy of the lock to fix a deadlock that can occur if
self._get_tls() is called while holding the lock.
This commit is contained in:
Douglas Raillard 2021-07-21 13:59:48 +01:00 committed by Marc Bonnici
parent f523afda95
commit 80c0e37d11

View File

@ -784,7 +784,7 @@ class tls_property:
def __init__(self, factory):
self.factory = factory
# Lock accesses to shared WeakKeyDictionary and WeakSet
self.lock = threading.Lock()
self.lock = threading.RLock()
def __get__(self, instance, owner=None):
return _BoundTLSProperty(self, instance, owner)