Fast mutex class. More...
|Lock the mutex. |
|Try to lock the mutex. |
|Unlock the mutex. |
Fast mutex class.
This is a mutual exclusion object for synchronizing access to shared memory areas for several threads. It is similar to the tthread::mutex class, but instead of using system level functions, it is implemented as an atomic spin lock with very low CPU overhead.
fast_mutex class is NOT compatible with the
condition_variable class (however, it IS compatible with the
lock_guard class). It should also be noted that the
fast_mutex class typically does not provide as accurate thread scheduling as a the standard
mutex class does.
Because of the limitations of the class, it should only be used in situations where the mutex needs to be locked/unlocked very frequently.
Try to lock the mutex.
The method will try to lock the mutex. If it fails, the function will return immediately (non-blocking).
trueif the lock was acquired, or
falseif the lock could not be acquired.
Unlock the mutex.
If any threads are waiting for the lock on this mutex, one of them will be unblocked.