Struct ScopedMutexLock
RAII lock for the Mutex class.
struct ScopedMutexLock(M)
if (is(shared(M) : shared(Mutex)) || is(shared(M) : shared(Lockable)));
Constructors
Name | Description |
this
(mutex, mode)
|
|
Properties
Name | Type | Description |
locked [get]
|
bool | |
Example
int protected_var = 0;
auto mtx = new TaskMutex;
mtx.performLocked!({
protected_var++;
});