Releases ownership of the specified mutex object.
BOOLEAN ReleaseMutex( HANDLE hMutex ); 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, ReleaseMutex 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 ReleaseMutex.
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 ReleaseMutex 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)
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 | intime/rt/include/iwin32.h intime/rt/include/winbase.h |
iwin32.h windows.h |
iwin32.lib |
Notes
RtCreateMutex, iwin32 API, iwin32 Overview