ConditionVariable Class

Definition

Line 18 of System.Base/ConditionVariable.cm

Constructors & Destructor

public nothrow ConditionVariable()
public nothrow ConditionVariable(ConditionVariable&& that)
suppress ConditionVariable(const ConditionVariable&)
public ~ConditionVariable()

Member Functions

public void NotifyAll() Signals the condition variable and unblocks all threads waiting on it.
public void NotifyOne() Signals the condition variable and unblocks one thread waiting on it.
public void Wait(RecursiveMutex& mtx) Locks the given recursive mutex internally and waits the condition variable to become signaled. The waiting is done with the recursive mutex unlocked.
public void Wait(RecursiveMutex& mtx, Predicate predicate, void* arg) Locks the given recursive mutex internally and waits until the given predicate returns true. The waiting is done with the recursive mutex unlocked.
public void Wait(RecursiveMutex& mtx, PredicateMethod predicateMethod, void* arg) Locks the given recursive mutex internally and waits until the given predicate method returns true. The waiting is done with the recursive mutex unlocked.
public bool WaitFor(RecursiveMutex& mtx, Predicate predicate, void* arg, const Duration& duration) Locks the given recursive mutex internally and waits until duration has been elapsed or the condition variable has become signaled. The waiting is done with the recursive mutex unlocked.
public bool WaitFor(RecursiveMutex& mtx, PredicateMethod predicateMethod, void* arg, const Duration& duration) Locks the given recursive mutex internally and waits until duration has been elapsed or the condition variable has become signaled. The waiting is done with the recursive mutex unlocked.
public ConditionVariableStatus WaitFor(RecursiveMutex& mtx, const Duration& duration) Locks the given recursive mutex internally and waits until duration has been elapsed or the condition variable has become signaled. The waiting is done with the recursive mutex unlocked.
public bool WaitUntil(RecursiveMutex& mtx, Predicate predicate, void* arg, const TimePoint& tp) Locks the given recursive mutex internally and waits until time point tp has been reached or the condition variable has become signaled. The waiting is done with the recursive mutex unlocked.
public bool WaitUntil(RecursiveMutex& mtx, PredicateMethod predicateMethod, void* arg, const TimePoint& tp) Locks the given recursive mutex internally and waits until time point tp has been reached or the condition variable has become signaled. The waiting is done with the recursive mutex unlocked.
public ConditionVariableStatus WaitUntil(RecursiveMutex& mtx, const TimePoint& tp) Locks the given recursive mutex internally and waits until time point tp has been reached or the condition variable has become signaled. The waiting is done with the recursive mutex unlocked.
suppress void operator=(ConditionVariable&)
public nothrow void operator=(ConditionVariable&& that)

Member Variables

private void* nativeHandle

Constructor& Destructor Details

ConditionVariable Constructor

public nothrow ConditionVariable()

Definition
Line 20 of System.Base/ConditionVariable.cm


ConditionVariable Constructor

public nothrow ConditionVariable(ConditionVariable&& that)

Definition
Line 32 of System.Base/ConditionVariable.cm


ConditionVariable Constructor

suppress ConditionVariable(const ConditionVariable&)

Definition
Line 30 of System.Base/ConditionVariable.cm


~ConditionVariable Destructor

public ~ConditionVariable()

Definition
Line 23 of System.Base/ConditionVariable.cm


Member Function Details

NotifyAll Member Function

public void NotifyAll()

Signals the condition variable and unblocks all threads waiting on it.

Definition
Line 50 of System.Base/ConditionVariable.cm


NotifyOne Member Function

public void NotifyOne()

Signals the condition variable and unblocks one thread waiting on it.

Definition
Line 40 of System.Base/ConditionVariable.cm


Wait Member Function

public void Wait(RecursiveMutex& mtx)

Locks the given recursive mutex internally and waits the condition variable to become signaled. The waiting is done with the recursive mutex unlocked.

After the call the recursive mutex is unlocked.

Definition
Line 60 of System.Base/ConditionVariable.cm


Wait Member Function

public void Wait(RecursiveMutex& mtx, Predicate predicate, void* arg)

Locks the given recursive mutex internally and waits until the given predicate returns true. The waiting is done with the recursive mutex unlocked.

The predicate is called with the given void* argument that can be null. After the call the recursive mutex is unlocked.

Definition
Line 86 of System.Base/ConditionVariable.cm


Wait Member Function

public void Wait(RecursiveMutex& mtx, PredicateMethod predicateMethod, void* arg)

Locks the given recursive mutex internally and waits until the given predicate method returns true. The waiting is done with the recursive mutex unlocked.

The predicate method is called with the given void* argument that can be null. After the call the recursive mutex is unlocked.

Definition
Line 109 of System.Base/ConditionVariable.cm


WaitFor Member Function

public bool WaitFor(RecursiveMutex& mtx, Predicate predicate, void* arg, const Duration& duration)

Locks the given recursive mutex internally and waits until duration has been elapsed or the condition variable has become signaled. The waiting is done with the recursive mutex unlocked.

Returns true if the condition variable has become signaled and the predicate returns true. Returns false if the condition variable has not become signaled after duration has been elapsed. The predicate is called with the given void* argument that can be null. After the call the recursive mutex is unlocked.

Definition
Line 93 of System.Base/ConditionVariable.cm


WaitFor Member Function

public bool WaitFor(RecursiveMutex& mtx, PredicateMethod predicateMethod, void* arg, const Duration& duration)

Locks the given recursive mutex internally and waits until duration has been elapsed or the condition variable has become signaled. The waiting is done with the recursive mutex unlocked.

Returns true if the condition variable has become signaled and the predicate method returns true. Returns false if the condition variable has not become signaled after duration has been elapsed. The predicate method is called with the given void* argument that can be null. After the call the recursive mutex is unlocked.

Definition
Line 116 of System.Base/ConditionVariable.cm


WaitFor Member Function

public ConditionVariableStatus WaitFor(RecursiveMutex& mtx, const Duration& duration)

Locks the given recursive mutex internally and waits until duration has been elapsed or the condition variable has become signaled. The waiting is done with the recursive mutex unlocked.

Returns ConditionVariableStatus.no_timeout if the condition variable has become signaled. Returns ConditionVariableStatus.timeout if the condition variable has not become signaled after duration has been elapsed. After the call the recursive mutex is unlocked.

Definition
Line 70 of System.Base/ConditionVariable.cm


WaitUntil Member Function

public bool WaitUntil(RecursiveMutex& mtx, Predicate predicate, void* arg, const TimePoint& tp)

Locks the given recursive mutex internally and waits until time point tp has been reached or the condition variable has become signaled. The waiting is done with the recursive mutex unlocked.

Returns true if the condition variable has become signaled and the predicate method returns true. Returns false if the condition variable has not become signaled after time point tp has been reached. The predicate is called with the given void* argument that can be null. After the call the recursive mutex is unlocked.

Definition
Line 104 of System.Base/ConditionVariable.cm


WaitUntil Member Function

public bool WaitUntil(RecursiveMutex& mtx, PredicateMethod predicateMethod, void* arg, const TimePoint& tp)

Locks the given recursive mutex internally and waits until time point tp has been reached or the condition variable has become signaled. The waiting is done with the recursive mutex unlocked.

Returns true if the condition variable has become signaled and the predicate method returns true. Returns false if the condition variable has not become signaled after time point tp has been reached. The predicate method is called with the given void* argument that can be null. After the call the recursive mutex is unlocked.

Definition
Line 127 of System.Base/ConditionVariable.cm


WaitUntil Member Function

public ConditionVariableStatus WaitUntil(RecursiveMutex& mtx, const TimePoint& tp)

Locks the given recursive mutex internally and waits until time point tp has been reached or the condition variable has become signaled. The waiting is done with the recursive mutex unlocked.

Returns ConditionVariableStatus.no_timeout if the condition variable has become signaled. Returns ConditionVariableStatus.timeout if the condition variable has not become signaled after time point tp has been reached. After the call the recursive mutex is unlocked.

Definition
Line 81 of System.Base/ConditionVariable.cm


operator= Member Function

suppress void operator=(ConditionVariable&)

Definition
Line 31 of System.Base/ConditionVariable.cm


operator= Member Function

public nothrow void operator=(ConditionVariable&& that)

Definition
Line 36 of System.Base/ConditionVariable.cm