Condition

This class represents a condition variable as conceived by C.A.R. Hoare. As per Mesa type monitors however, "signal" has been replaced with "notify" to indicate that control is not transferred to the waiter when a notification is sent.

version(!Tango)
class Condition {
HANDLE m_blockLock;
HANDLE m_blockQueue;
Mutex m_assocMutex;
CRITICAL_SECTION m_unblockLock;
int m_numWaitersGone;
int m_numWaitersBlocked;
int m_numWaitersToUnblock;
Mutex m_assocMutex;
pthread_cond_t m_hndl;
}

Constructors

this
this(Mutex m)

Initializes a condition object which is associated with the supplied mutex object.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

notify
void notify()

Notifies one waiter.

notifyAll
void notifyAll()

Notifies all waiters.

wait
void wait()

Wait until notified.

wait
bool wait(Duration val)

Suspends the calling thread until a notification occurs or until the supplied time period has elapsed.

Properties

mutex
Mutex mutex [@property getter]

Gets the mutex associated with this condition.

Meta