.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_Mutex: Mutex ===== **Inherits:** :ref:`Reference` **<** :ref:`Object` **Category:** Core Brief Description ----------------- A synchronization Mutex. Member Functions ---------------- +------------------------+----------------------------------------------------+ | void | :ref:`lock` **(** **)** | +------------------------+----------------------------------------------------+ | :ref:`int` | :ref:`try_lock` **(** **)** | +------------------------+----------------------------------------------------+ | void | :ref:`unlock` **(** **)** | +------------------------+----------------------------------------------------+ Description ----------- A synchronization Mutex. Element used in multi-threadding. Basically a binary :ref:`Semaphore`. Guarantees that only one thread has this lock, can be used to protect a critical section. Member Function Description --------------------------- .. _class_Mutex_lock: - void **lock** **(** **)** Lock this :ref:`Mutex`, blocks until it is unlocked by the current owner. .. _class_Mutex_try_lock: - :ref:`int` **try_lock** **(** **)** Try locking this :ref:`Mutex`, does not block. Returns OK on success else ERR_BUSY. .. _class_Mutex_unlock: - void **unlock** **(** **)** Unlock this :ref:`Mutex`, leaving it to others threads.