mozilla::CondVar

Jump to:

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 Notifyed.

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 Locked the mutex undergirding this CondVar. Does not incur a runtime penalty in optimized builds.

AssertNotCurrentThreadOwnsMutex()

Assert that the current thread has not successfully Locked the mutex undergirding this CondVar. Does not incur a runtime penalty in optimized builds.

See also

Document Tags and Contributors

Contributors to this page: fscholz, Sheppy, teoli, Ted_Mielczarek, cgj
Last updated by: fscholz,