#include <nitro/os.h>
void OS_LockMutex( OSMutex* mutex );
mutex | Pointer to the Mutex structure |
None.
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.
OS_InitMutex, OS_UnlockMutex, OS_TryLockMutex
, OS_ExitThread
04/05/2004 Added description of mutex unlock with OS_ExitThread()
.
12/01/2003 Initial version .