Extends QMutex (which serves as access serialization between threads).  
 More...
|  | 
| def | __init__ (self, args, kargs) | 
|  | 
| def | tryLock (self, timeout=None, id=None) | 
|  | Try to lock the mutex.  More... 
 | 
|  | 
| def | lock (self, id=None) | 
|  | Lock mutex.  More... 
 | 
|  | 
| def | unlock (self) | 
|  | Unlock mutex. 
 | 
|  | 
| def | acquire (self, blocking=True) | 
|  | Mimics threading.Lock.acquire() to allow this class as a drop-in replacement. 
 | 
|  | 
| def | release (self) | 
|  | Mimics threading.Lock.release() to allow this class as a drop-in replacement. 
 | 
|  | 
| def | depth (self) | 
|  | Depth of traceback.  More... 
 | 
|  | 
| def | traceback (self) | 
|  | Get traceback.  More... 
 | 
|  | 
| def | __exit__ (self, args) | 
|  | Exit context.  More... 
 | 
|  | 
| def | __enter__ (self) | 
|  | Enter context.  More... 
 | 
|  | 
Extends QMutex (which serves as access serialization between threads). 
This class provides:
- Warning messages when a mutex stays locked for a long time. (if initialized with debug=True)
- Drop-in replacement for threading.Lock
- Context management (enter/exit) 
◆ __enter__()
      
        
          | def core.util.mutex.Mutex.__enter__ | ( |  | self | ) |  | 
      
 
Enter context. 
- Parameters
- 
  
  
- Returns
- QMutex: this mutex 
 
 
◆ __exit__()
      
        
          | def core.util.mutex.Mutex.__exit__ | ( |  | self, | 
        
          |  |  |  | args | 
        
          |  | ) |  |  | 
      
 
 
◆ depth()
      
        
          | def core.util.mutex.Mutex.depth | ( |  | self | ) |  | 
      
 
Depth of traceback. 
- Returns
- int: depth of traceback 
 
 
◆ lock()
      
        
          | def core.util.mutex.Mutex.lock | ( |  | self, | 
        
          |  |  |  | id = None | 
        
          |  | ) |  |  | 
      
 
Lock mutex. 
Will try again every 5 seconds. 
       @param id: debug id
 
 
 
◆ traceback()
      
        
          | def core.util.mutex.Mutex.traceback | ( |  | self | ) |  | 
      
 
Get traceback. 
- Returns
- list: traceback 
 
 
◆ tryLock()
      
        
          | def core.util.mutex.Mutex.tryLock | ( |  | self, | 
        
          |  |  |  | timeout = None, | 
        
          |  |  |  | id = None | 
        
          |  | ) |  |  | 
      
 
Try to lock the mutex. 
- Parameters
- 
  
    | timeout | int: give up after this many milliseconds |  | id | debug id |  
 
- Returns
- bool: whether locking succeeded 
 
 
The documentation for this class was generated from the following file: