# OS_ExitThread

## C Specification

      #include <nitro/os.h>

      void OS_ExitThread( void );

## Arguments

None.

## Return Values

None.

## Description

This terminates the current thread, then switches to the next executable thread.

All locked mutex of the specified thread are unlocked. Therefore, if there is a thread that becomes executable by unlocking mutex, that thread is executed before a thread that becomes executable due to the end of the current thread.

This function automatically executes when the designated function ends when a thread is generated.

## See Also

`OS_InitThread, OS_CreateThread, OS_WakeupThread, OS_WakeupThreadDirect`
`OS_DestroyThread`

## Revision History

04/05/2004 Added description of unlocking locked mutex
12/01/2003 Initial version