OSLockMutex

Syntax

#include <revolution/os.h>

void OSLockMutex(OSMutex* mutex);

Arguments

mutex Pointer to mutex.

Return Values

None.

Description

The calling thread tries to lock the mutex specified by mutex.

When mutex is maintained by another thread, the calling thread is suspended 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.

See Also

Thread Functions, Thread Synchronization Functions, OSInitCond, OSInitMutex, OSSignalCond, OSTryLockMutex, OSUnlockMutex, OSWaitCond

Revision History

2006/03/01 Initial version.


CONFIDENTIAL