# OS_UnlockMutex

## C Specification

  `#include <nitro/os.h>`
  `void OS_UnlockMutex( OSMutex* mutex );`

## Arguments

mutex | Pointer to the Mutex structure

## Return Values

None.

## Description

Releases Mutex The thread calling this function must be the mutex owner.

However, when the calling thread has locked mutex n times, only the mutex lock by the nth `OS_LockMutex()` is released.

When the thread that locks mutex is terminated with `OS_ExitThread()` that mutex is automatically unlocked.

## See Also

`OS_InitMutex`, `OS_LockMutex`, `OS_TryLockMutex`, `OS_ExitThread`

## Revision History

04/05/2004 Added description of mutex unlock with `OS_ExitThread()`.
12/01/2003 Initial version