#include <revolution/os.h>
void OSLockMutex (OSMutex* mutex);
|
Pointer to mutex. |
None.
The calling thread tries to lock the mutex that mutex specifies.
If another thread has mutex locked, the calling thread temporarily stops until mutex is released. If the priority of the calling thread is higher than the thread that owns a mutex, the inheritance mechanism of the normal priority promotes the valid priority of the thread that owns a mutex.
If the current thread already owns mutex, unnecessary calls to the OSLockMutex function will return immediately. Note that each call to the OSUnlockMutex function must correspond to a call to the OSLockMutex function; otherwise, mutex will remain locked. This allows one thread to safely nest multiple calls to the OSLockMutex and OSUnlockMutex functions for the same mutex.
Thread Functions, Thread Synchronization Functions, OSInitCond, OSInitMutex, OSSignalCond, OSTryLockMutex, OSUnlockMutex, OSWaitCond
03/01/2006 Initial version.