INtime SDK Help
RtReleaseMutex (iwin32x)
INtime SDK v7 > About INtime > Alternate APIs > iwin32 API > iwin32x API > RtReleaseMutex (iwin32x)

Releases ownership of the specified mutex object.

BOOLEAN RtReleaseMutex(
    HANDLE hMutex
);

Parameters

hMutex
Handle to the mutex object. RtCreateMutex returns this handle.

Remarks

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).

Return Values

Non-zero
Success.
0 (zero)
Failure. For extended error information, see the Windows' GetLastError function.

Remarks

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).

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/nt/include/iwin32x.h iwin32x.h iwin32x.lib

Notes

See Also

RtCreateMutex, iwin32x API, iwin32 Overview