mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-04 07:51:21 +00: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:
		
				
					committed by
					
						
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							f523afda95
						
					
				
				
					commit
					80c0e37d11
				
			@@ -784,7 +784,7 @@ class tls_property:
 | 
				
			|||||||
    def __init__(self, factory):
 | 
					    def __init__(self, factory):
 | 
				
			||||||
        self.factory = factory
 | 
					        self.factory = factory
 | 
				
			||||||
        # Lock accesses to shared WeakKeyDictionary and WeakSet
 | 
					        # Lock accesses to shared WeakKeyDictionary and WeakSet
 | 
				
			||||||
        self.lock = threading.Lock()
 | 
					        self.lock = threading.RLock()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __get__(self, instance, owner=None):
 | 
					    def __get__(self, instance, owner=None):
 | 
				
			||||||
        return _BoundTLSProperty(self, instance, owner)
 | 
					        return _BoundTLSProperty(self, instance, owner)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user