Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
P6R::p6IMonitor Interface Referenceabstract

#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
 

Detailed Description

A intraprocess, reentrant lock/condition variable.

A monitor provides both (reentrant) mutual exclusion and thread cooperation via a condition variable.

Example of calling notify

* pMonitor->lock();
* some_condition = P6TRUE;
* pMonitor->notify();
* pMonitor->unlock();
*

The thread being notified should be waiting like this:

* pMonitor->lock();
* while(P6FALSE == some_condition)
* pMonitor->wait();
* pMonitor->unlock();
*

It is important for the wait() method tobe called in the while loop testing the condition to prevent spurious wakeups on some platforms.

Definition at line 79 of file p6lock.h.


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