#include <gauge3d/osabstraction/thread.h>
Inherits GAUGE3D::GObject.
Public Methods | |
GMutex () | |
Create the mutex. | |
~GMutex () | |
Destroy the mutex. It must be unlocked when this happens. | |
void | Lock () |
Wait until mutex is unlocked, and then lock the mutex to this thread. | |
bool | TryLock () |
Check if mutex is locked, and lock it to this thread if not. More... | |
void | Unlock () |
Release lock on a thread. More... |
If two or more threads can access the same data, and at least one is writing to it, you should use a mutex to prevent them from accessing it at the same time.
|
Check if mutex is locked, and lock it to this thread if not.
|
|
Release lock on a thread. Only the thread that the mutex is locked to may call this. |