#include <p6lock.h>
Inherits P6R::p6ICom.
Public Member Functions | |
virtual P6R::P6INT32 | addref ()=0 |
virtual P6R::P6ERR | initialize ()=0 |
virtual P6R::P6ERR | lock ()=0 |
virtual P6R::P6ERR | notify ()=0 |
virtual P6R::P6ERR | notifyAll ()=0 |
virtual P6R::P6ERR | queryInterface (const P6R::IID &iid, P6R::P6VOID **ppIface)=0 |
virtual P6R::P6INT32 | release ()=0 |
virtual P6R::P6ERR | unlock ()=0 |
virtual P6R::P6ERR | wait ()=0 |
virtual P6R::P6ERR | waitTimed (P6R::P6INTERVAL tTimeout)=0 |
A intraprocess, reentrant lock/condition variable.
A monitor provides both (reentrant) mutual exclusion and thread cooperation via a condition variable.
Example of calling notify
The thread being notified should be waiting like this:
It is important for the wait() method tobe called in the while loop testing the condition to prevent spurious wakeups on some platforms.