class_docstr: Subclass of QMutex that provides useful debugging information during
  deadlocks--tracebacks are printed for both the code location that is 
  attempting to lock the mutex as well as the location that has already
  acquired the lock.
  
  Also provides __enter__ and __exit__ methods for use in "with" statements.
class_docstr_tok: ["Subclass","of","QMutex","that","provides","useful","debugging","information","during","deadlocks","--","tracebacks","are","printed","for","both","the","code","location","that","is","attempting","to","lock","the","mutex","as","well","as","the","location","that","has","already","acquired","the","lock",".","Also","provides","__enter__","and","__exit__","methods","for","use","in","``","with","''","statements","."]
code: def lock(self, id=None):
      c = 0
      waitTime = 5000  # in ms
      while True:
          if self.tryLock(waitTime, id):
              break
          c += 1
          if self.debug:
              self.l.lock()
              try:
                  print(
                      "Waiting for mutex lock (%0.1f sec). Traceback follows:"
                      % (c * waitTime / 1000.0)
                  )
                  traceback.print_stack()
                  if len(self.tb) > 0:
                      print("Mutex is currently locked from:\n")
                      print(self.tb[-1])
                  else:
                      print("Mutex is currently locked from [???]")
              finally:
                  self.l.unlock()
  
file_path: pyqtgraph/pyqtgraph/util/mutex.py
imports: import traceback
  from ..Qt import QtCore
label_desc: Use image node_id 3 for calling the Mutex obj's underlying member method code with example usage: obj.lock(id) without return types