Defined in:Acquires exclusive ownership of a mutex.
Acquirefunction acquires exclusive ownership of a mutex. If the mutex is already owned by another thread when this function is called, then the calling thread blocks until the mutex becomes available.
Ownership of a mutex is relinquished by calling the
Mutex::Releasefunction from the same thread that called the
All mutexes are recursive, meaning that a thread already owning a mutex may reacquire the same mutex without deadlocking, and the system maintains an internal acquisition count. Each call to the
Acquirefunction must be balanced by a corresponding call to the
Mutex::Releasefunction by the same thread.
Mutex::TryAcquirefunction allows the caller to attempt to acquire ownership of a mutex without blocking if the acquisition attempt fails.