Loki
0.1.7
|
#include <LevelMutex.h>
Public Member Functions | |
SpinLevelMutex (unsigned int level) | |
Constructs a spin-level mutex. | |
virtual | ~SpinLevelMutex (void) |
Destructs the mutex. | |
Implements a spin-loop to wait for the mutex to unlock. Since this class makes the thread wait in a tight spin-loop, it can cause the thread to remain busy while waiting and thus consume CPU cycles. For that reason, this mutex is best used only for very low-level resources - especially resources which do not require much CPU time to exercise. Rule of thumb: Use this only if all actions on the resource consume a very small number of CPU cycles. Otherwise, use the SleepLevelMutex instead.