# OS_JoinThread

## C Specification

      #include <nitro/os.h>

      void OS_JoinThread( OSThread* thread );

## Arguments

thread | Points to the thread to be joined.

## Return Values

None.

## Description

Joins a thread and waits until the specified thread has terminated If the specified thread has already terminated, this function doesn't do anything.

Within this function, the thread that is called registers itself in the thread queue specified by the specified thread. It then goes to sleep in response to `OS_SleepThread()`. When the specified thread is terminated by `OS_ExitThread()`, it changes the state of all threads registered in the thread queue to executable and reschedules them, regardless of their status.

Multiple threads may be joined to a single thread using `OS_JoinThread()`.

## See Also

`OS_InitThread, OS_SleepThread, OS_ExitThread
`

## Revision History

11/10/2004 Simplified description
06/26/2004 Initial version

CONFIDENTIAL