Skip to content

Mutex

Qt Base Class: QMutex

Signature: QMutex(self) -> None

Base classes

Name Children Inherits
QMutex
PySide6.QtCore
QMutex(self) -> None

⋔ Inheritance diagram

graph TD
  1473299779888["core.Mutex"]
  1473289046224["QtCore.QMutex"]
  1473289045248["QtCore.QBasicMutex"]
  1473291690208["Shiboken.Object"]
  140713234304496["builtins.object"]
  1473289046224 --> 1473299779888
  1473289045248 --> 1473289046224
  1473291690208 --> 1473289045248
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: QMutex

Access serialization between threads.

Source code in prettyqt\core\mutex.py
class Mutex(QtCore.QMutex):
    """Access serialization between threads."""

    @contextlib.contextmanager
    def lock_mutex(self, timeout: int | None = None):
        if timeout is None:
            timeout = -1
        yield self.tryLock(timeout)
        self.unlock()