uThreads  0.3.0
Public Member Functions | List of all members
ConditionVariable Class Reference

A user level condition variable. More...

#include <BlockingSync.h>

Public Member Functions

void wait (Mutex &mutex)
 Block uThread on the condition variable using the provided mutex. More...
 
void signal (Mutex &mutex)
 Unblock one uThread waiting on the condition variable. More...
 
void signalAll (Mutex &mutex)
 unblock all uThreads waiting on the condition variable More...
 
bool empty ()
 Whether the waiting list is empty or not. More...
 

Detailed Description

A user level condition variable.

User-level Condition Variable blocks only in user-level by suspending the uThreads instead of blocking the kernel threads.

Member Function Documentation

bool ConditionVariable::empty ( )
inline

Whether the waiting list is empty or not.

Returns
Whether the waiting list is empty or not
void ConditionVariable::signal ( Mutex mutex)
inline

Unblock one uThread waiting on the condition variable.

Parameters
mutexThe mutex to be released after unblocking is done
void ConditionVariable::signalAll ( Mutex mutex)
inline

unblock all uThreads waiting on the condition variable

Parameters
mutexThe mutex to be released after unblocking is done
void ConditionVariable::wait ( Mutex mutex)
inline

Block uThread on the condition variable using the provided mutex.

Parameters
mutexused to synchronize access to the condition

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