void OSFastMutex_Unlock (OSFastMutex* fastMutex);
||Pointer to fast mutex.
The calling thread that unlocks the fast mutex that fastMutex specifies must own the fast mutex.
- If the calling thread locked fast mutex that fastMutex specifies n times, the fast mutex is unlocked only on the nth call to the
- If the calling thread had a temporarily higher priority because a higher priority thread requested this mutex, the priority is recalculated. The recalculated priority may not result in the standard priority because it depends on other mutexes that are retained.
- If the fast mutex that fastMutex specifies is unlocked, all threads that the fast mutex specified by fastMutex blocks receive executable status and execute according to priority.
There are several major differences between a mutex and a fast mutex.
- With a fast mutex, there is less contention for the
OSSchedulerLock. All mutex acquire and release the
OSSchedulerLock each time a mutex is used. A fast mutex uses atomic operations first and then, only if there is contention, the
OSSchedulerLock is taken. Because of this, a fast mutex may lock and unlock approximately 3X faster than a mutex.
- A fast mutex does not present a cancel-point where a thread can be canceled immediately after an unlock.
- If another thread has a fast mutex locked, the calling thread stops temporarily until the fast mutex is released. If the priority of the calling thread is higher than the thread that owns the fast mutex, the inheritance mechanism of the normal priority promotes the valid priority of the thread that owns the fast mutex.
- If the current thread already owns fast mutex, unnecessary calls to the
OSFastMutex_Lock function return immediately. Each call to the
OSFastMutex_Unlock function must correspond to a call to the
OSFastMutex_Lock function. Otherwise, the fast mutex remains locked. This allows one thread to safely nest multiple calls to the
OSFastMutex_Unlock functions for the same fast mutex.
Do Not Call From
||Do not call this function from any callback function.
2013/04/24 Initial version.