Go to the first, previous, next, last section, table of contents.


CV

Condition variables (CV) are attached to mutexes when they are created. You need to ask a mutex to create a condition variable.

class CV { public:
    void wait();
    void signal();
    void broadcast();

    void aWait();
    void aSignal();
    void aBroadcast();

    static CV* reify (CV_T);
    static void destroy (CV*);
}

CV method: void wait ()
Block the calling thread until reception of a signal associated to this CV. That is until another thread invokes a signal or broadcast operation on this CV.

CV method: void signal ()
Send a signal to one (undeterministic) of the threads waiting on the CV

CV method: void broadcast ()
Send a signal to all the threads waiting on the CV.

wait, signal and broadcast require their associated mutex to be acquired.

aWait, aSignal and aBroadcast are the corresponding functions which acquire and release their locks implicitely. So their locks must not be taken before calling them (dead-lock).

CV method: void destroy ()
Destroy a CV.

CV method: CV* reify (CV_T cvid)
Register the CV identified by cvid in the raw package and return its corresponding CV instance.


Go to the first, previous, next, last section, table of contents.