vibe.d beta banner
get vibe.d
0.8.4

Asynchronous I/O that doesn’t get in your way, written in D

Struct ScopedMutexLock

RAII lock for the Mutex class.

struct ScopedMutexLock(M) ;

Constructors

NameDescription
this

Fields

NameTypeDescription
m_locked bool
m_mode LockMode
m_mutex M

Properties

NameTypeDescription
locked[get] bool

Methods

NameDescription
lock
tryLock
unlock

Example

int protected_var = 0;
auto mtx = new TaskMutex;
mtx.performLocked!({
	protected_var++;
});
Authors

Leonid Kramer, Sönke Ludwig, Manuel Frischknecht

Copyright

© 2012-2016 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.