mozilla::CondVar
is a bare wrapper around PRCondVar
. Please see Introduction_to_NSPR for a high-level summary of its semantics.
#include "CondVar.h"
Methods
Constructor
CondVar(Mutex& aMutex, const char* aName)
Initialize the CondVar with its associated mutex and a name to reference it by.
Wait()
nsresult Wait( in PRIntervalTime interval = PR_INTERVAL_NO_TIMEOUT );
Wait on this CondVar
until it is Notify
ed.
Notify()
nsresult Notify(void);
Notify one thread waiting on this CondVar
.
NotifyAll()
nsresult NotifyAll(void);
Notify all threads waiting on this CondVar
.
AssertCurrentThreadOwnsMutex()
Assert that the current thread has successfully Lock
ed the mutex undergirding this CondVar
. Does not incur a runtime penalty in optimized builds.
AssertNotCurrentThreadOwnsMutex()
Assert that the current thread has not successfully Lock
ed the mutex undergirding this CondVar
. Does not incur a runtime penalty in optimized builds.