![]() |
Xyris
0.5
|
#include "Mutex.hpp"
Go to the source code of this file.
Data Structures | |
class | RAIIMutex |
Functions | |
template<typename Function > | |
void | lockedRegion (Function lockedWork, Mutex &mutex) |
Resource Acquisition Is Initialization mutex. Locks when constructed and unlocks when destructed.
Definition in file RAII.hpp.
void lockedRegion | ( | Function | lockedWork, |
Mutex & | mutex | ||
) |
Mutex protected region lambda function. Executed the provided function after locking the provided mutex. Unlocks before returning. Provided lambda function cannot return any value, but may return at any point safely.
Function | Lambda function template |
lockedWork | Function to be executed in a safe manner |
mutex | Mutex to lock before lambda execution |