1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the Mutex.xml source instead.
- .. The source is found in doc/classes or modules/<name>/doc_classes.
- .. _class_Mutex:
- Mutex
- =====
- **Inherits:** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
- **Category:** Core
- Brief Description
- -----------------
- A synchronization Mutex.
- Member Functions
- ----------------
- +------------------------+----------------------------------------------------+
- | void | :ref:`lock<class_Mutex_lock>` **(** **)** |
- +------------------------+----------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`try_lock<class_Mutex_try_lock>` **(** **)** |
- +------------------------+----------------------------------------------------+
- | void | :ref:`unlock<class_Mutex_unlock>` **(** **)** |
- +------------------------+----------------------------------------------------+
- Description
- -----------
- A synchronization Mutex. Element used in multi-threadding. Basically a binary :ref:`Semaphore<class_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<class_mutex>`, blocks until it is unlocked by the current owner.
- .. _class_Mutex_try_lock:
- - :ref:`int<class_int>` **try_lock** **(** **)**
- Try locking this :ref:`Mutex<class_mutex>`, does not block. Returns OK on success else ERR_BUSY.
- .. _class_Mutex_unlock:
- - void **unlock** **(** **)**
- Unlock this :ref:`Mutex<class_mutex>`, leaving it to others threads.
|