#include <cafe/os.h> void OSLockMutex (OSMutex* mutex);
|mutex||Pointer to mutex.|
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
OSUnlockMutex functions for the same mutex.
|Callbacks||Do not call this function from any callback function.|
2013-05-08 Automated cleanup pass.
2010-08-30 Initial version.