RR Thread Pool
 All Classes Functions Typedefs Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
ICond Class Referenceabstract

A condition variable to allow synchronization between threads. More...

#include <Cond.h>

Public Member Functions

virtual ~ICond ()
 Destructor.
 
virtual void wait (IMutex *mutex)=0
 The calling thread will wait until the condition variable is signaled by another thread. More...
 
virtual void signal ()=0
 Resumes at least one single thread that is waiting for the condition. More...
 
virtual void broadcast ()=0
 Resumes all threads that are waiting for the condition. More...
 
virtual void * handle ()=0
 Returns the platform dependent handle associated to this object.
 

Static Public Member Functions

static ICondcreate ()
 Creates one new condition variable.
 

Detailed Description

A condition variable to allow synchronization between threads.

Condition variables are synchronization primitives to allow threads to wait until a particular condition occurs.

Member Function Documentation

virtual void ICond::broadcast ( )
pure virtual

Resumes all threads that are waiting for the condition.

Calling the method without no threads waiting for signals have no effect.

virtual void ICond::signal ( )
pure virtual

Resumes at least one single thread that is waiting for the condition.

Calling the method without no threads waiting for signals have no effect.

virtual void ICond::wait ( IMutex mutex)
pure virtual

The calling thread will wait until the condition variable is signaled by another thread.

This method atomically performs this steps:

  • unlocks the passed mutex.
  • wait for a signal from another thread (see methods signal and broadcast).
  • locks again the mutex.
Parameters
mutexThe mutex to be unlocked/locked.
Precondition
  1. The passed mutex is currently locked by the calling thread.
Postcondition
  1. The passed mutex is locked back by the calling thread.

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