TaskReadWriteMutex

A ReadWriteMutex implementation for fibers.

This mutex can be used in exchange for a core.sync.mutex.ReadWriteMutex, but does not block the event loop in contention situations. The reader and writer members are used for locking. Locking the reader mutex allows access to multiple readers at once, while the writer mutex only allows a single writer to lock it at any given time. Locks on reader and writer are mutually exclusive (i.e. whenever a writer is active, no readers can be active at the same time, and vice versa).

Notice: Mutexes implemented by this class cannot be interrupted using vibe.core.task.Task.interrupt(). The corresponding InterruptException will be deferred until the next blocking operation yields the event loop.

Use InterruptibleTaskReadWriteMutex as an alternative that can be interrupted.

cf. core.sync.mutex.ReadWriteMutex

Constructors

this
this(Policy policy)
Undocumented in source.

Members

Aliases

Policy
alias Policy = State.Policy

The policy with which the mutex should operate.

Reader
alias Reader = Mutex!READ_ONLY
Undocumented in source.
Writer
alias Writer = Mutex!READ_WRITE
Undocumented in source.

Classes

Mutex
class Mutex(LockingIntent INTENT)

A common baseclass for both of the provided mutexes.

Properties

policy
Policy policy [@property getter]

The policy with which the lock has been created.

Variables

reader
Reader reader;
Undocumented in source.
writer
Writer writer;
Undocumented in source.

Meta