Arachne  0.1
Public Member Functions | List of all members
Arachne::ConditionVariable Class Reference

#include <Arachne.h>

Public Member Functions

void notifyOne ()
 
void notifyAll ()
 
template<typename LockType >
void wait (LockType &lock)
 
template<typename LockType >
void waitFor (LockType &lock, uint64_t ns)
 

Detailed Description

This class enables one or more threads to block until a condition is true, and then be awoken when the condition might be true.

Member Function Documentation

void Arachne::ConditionVariable::notifyAll ( )

Awaken all of the threads waiting on this condition variable. The caller must hold the mutex that waiting threads held when they called wait().

void Arachne::ConditionVariable::notifyOne ( )

Awaken one of the threads waiting on this condition variable. The caller must hold the mutex that waiting threads held when they called wait().

template<typename LockType >
void Arachne::ConditionVariable::wait ( LockType &  lock)

Block the current thread until the condition variable is notified.

Parameters
lockThe mutex associated with this condition variable; must be held by caller before calling wait. This function releases the mutex before blocking, and re-acquires it before returning to the user.
template<typename LockType >
void Arachne::ConditionVariable::waitFor ( LockType &  lock,
uint64_t  ns 
)

Block the current thread until the condition variable is notified or at least ns nanoseconds has passed.

Parameters
lockThe mutex associated with this condition variable; must be held by caller before calling wait. This function releases the mutex before blocking, and re-acquires it before returning to the user.
nsThe time in nanoseconds this thread should wait before returning in the absence of a signal.

The documentation for this class was generated from the following files: