vibe.d beta banner
get vibe.d
0.10.1

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

Struct Monitor

Synchronization primitive to ensure accessing a piece of data is always protected by a locked mutex.

struct Monitor(T, M) ;

This struct ensures through its API that the encapsulated data cannot be accessed without the associated mutex being locked. It should always be preferred over manually locking a mutex and casting away shared.

Fields

NameTypeDescription
data Monitor.Data
mutex Monitor.Mutex

Methods

NameDescription
initialize (m)
lock ()
lock ()

Inner structs

NameDescription
Locked

Aliases

NameDescription
Data
Mutex

See also

createMonitor

Authors

Leonid Kramer, Sönke Ludwig, Manuel Frischknecht

Copyright

© 2012-2019 Sönke Ludwig

License

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