#include <revolution/os.h>
void OSLockMutex(OSMutex* mutex);
|
Pointer to mutex. |
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. Note the fact that if the priority of the calling thread is higher than the thread that owns the mutex, the active priority of the thread that owns the mutex will be raised under the basic priority inheritance mechanism of the system.
If mutex is already saved for the current thread, unnecessary OSLockMutex function calls will return quickly. Note that each OSUnlockMutex function call must correspond to a OSLockMutex function call or the mutex will not be freed. This allows the safe nesting of multiple calls to OSLockMutex and OSUnlockMutex for the same mutex.
This function may put the current thread to sleep. For precautions when calling similar functions, refer to Interrupts and Callback Functions.
Thread Functions, Thread Synchronization Functions,
OSInitCond, OSInitMutex, OSSignalCond, OSTryLockMutex, OSUnlockMutex, OSWaitCond, Interrupts and Callback Functions
2007/09/25 Added information on the sleeping status of threads.
2006/03/01 Initial version.
CONFIDENTIAL