#include <p6lock.h>
Inherits P6R::p6ICom.
Public Member Functions | |
virtual P6INT32 | addref (void)=0 |
virtual P6R::P6ERR | initialize (void)=0 |
virtual P6R::P6ERR | lock (void)=0 |
virtual P6R::P6ERR | notify (void)=0 |
virtual P6R::P6ERR | notifyAll (void)=0 |
virtual P6R::P6ERR | queryInterface (const P6R::P6IID &iid, P6VOID **ppIface)=0 |
virtual P6INT32 | release (void)=0 |
virtual P6R::P6ERR | unlock (void)=0 |
virtual P6R::P6ERR | wait (void)=0 |
virtual P6R::P6ERR | waitTimed (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.