OS_LockMutex

C Specification

#include <nitro/os.h>

void OS_LockMutex( OSMutex* mutex );

Arguments

mutex Pointer to the Mutex structure

Return Values

None.

Description

The calling thread tries to lock the mutex specified by mutex.

When mutex is being maintained by another thread, the calling thread is temporarily stopped until mutex is released. If mutex is being maintained in the current thread, it returns immediately. However, the number of times OS_LockMutex() is called is recorded, and mutexmust be unlocked the same number of times.

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

See Also

OS_InitMutex, OS_UnlockMutex, OS_TryLockMutex, OS_ExitThread

Revision History

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