Mutexclass encapsulates a mutual exclusion object for multithreaded synchronization.
||Acquires exclusive ownership of a mutex.|
||Attempts to acquire exclusive ownership of a mutex.|
||Releases ownership of a mutex.|
Mutexclass defines a platform-independent mutual exclusion object that can be used for multithreaded synchronization. A mutex can only be owned by one thread at a time and when properly used prevents simultaneous access to resources by multiple threads.
Ownership of a mutex is acquired by calling the
Mutex::Acquirefunction. If the mutex is already owned by a different thread when this function is called, then the calling thread blocks until the mutex becomes available. The
Mutex::TryAcquirefunction attempts to acquire ownership of a mutex, but does not block if acquisition fails. Ownership of a mutex is relinquished by calling the
WARNING. If a mutex object is destroyed while a thread is waiting to acquire it, then the behavior is undefined.