OSLockMutex

Syntax

#include <cafe/os.h>

void OSLockMutex (OSMutex* mutex);

Parameters

mutex Pointer to mutex.

Return Values

None.

Description

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.

Do Not Call From

Callbacks Do not call this function from any callback function.

See Also

OSInitCond
OSInitMutex
OSSignalCond
OSTryLockMutex
OSUnlockMutex
OSWaitCond

Revision History

2013-05-08 Automated cleanup pass.
2010-08-30 Initial version.


CONFIDENTIAL