#include <cafe/os.h> BOOL OSFastMutex_TryLock (OSFastMutex* fastMutex);
|fastMutex||Pointer to fast mutex.|
TRUE if the fast mutex is successfully locked. Otherwise, returns
The calling thread tries to lock the fast mutex that fastMutex specifies.
FALSE is returned if the specified fast mutex is already locked.
There are several major differences between a mutex and a fast mutex.
OSSchedulerLock. All mutex acquire and release the
OSSchedulerLockeach time a mutex is used. A fast mutex uses atomic operations first and then, only if there is contention, the
OSSchedulerLockis taken. Because of this, a fast mutex may lock and unlock approximately 3X faster than a mutex.
OSFastMutex_Lockfunction return immediately. Each call to the
OSFastMutex_Unlockfunction must correspond to a call to the
OSFastMutex_Lockfunction. Otherwise, the fast mutex remains locked. This allows one thread to safely nest multiple calls to the
OSFastMutex_Unlockfunctions for the same fast mutex.
|Callbacks||Do not call this function from any callback function.|
2013/04/24 Initial version.