Releases ownership of the specified mutex object.
BOOLEAN RtReleaseMutex( HANDLE hMutex );
hMutex
You cannot call this function from a pure INtime thread. RtReleaseMutex can also be used from a Windows application to release an iwin32 mutex.
If the calling thread does not own the mutex object, RtReleaseMutex fails.
A thread gets ownership of a mutex by specifying a handle to the mutex in a wait function. The thread that creates a mutex object can also get immediate ownership without using a wait function. When the owning thread no longer needs to own the mutex object, it calls RtReleaseMutex.
While a thread owns a mutex, it can specify the same mutex in additional wait-function calls without blocking its execution. This prevents a thread from deadlocking itself while waiting for a mutex it already owns. However, to release its ownership, the thread must call RtReleaseMutex once for each time the mutex satisfied a wait function call.
When a thread fully releases the last mutex it owns, its priority is restored to what it was upon entering the first mutex (it may have changed when a better priority thread entered the wait queue for an owned mutex).
0
(zero)
When a thread fully releases the last mutex it owns, its priority is restored to what it was when it entered the first mutex (it may have been changed when a better priority thread entered the wait queue for one of the owned mutexes).
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 | intime/nt/include/iwin32x.h | iwin32x.h | iwin32x.lib |
Notes
RtCreateMutex, iwin32x API, iwin32 Overview