Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

mclevent.h

Go to the documentation of this file.
00001 /********************************************************************
00002        Copyright (c) 2001, Lee Patterson & Ant Works Software
00003        http://ssobjects.sourceforge.net
00004 
00005        Original source from Win32 Multithreaded Programming
00006        Copyright (c) 1997 by Aaron Michael Cohen and Mike Woodring
00007 
00008        filename :  mclevent.h
00009        author   :  Lee Patterson (lee@antws.com)
00010 *********************************************************************/
00011 
00012 #ifndef __CMCLEVENT_H__
00013 #define __CMCLEVENT_H__
00014 
00015 #include <pthread.h>
00016 #include "msdefs.h"
00017 
00018 namespace ssobjects
00019 {
00020 
00021 class CMclEvent
00022 {
00023   private:
00024     enum
00025       {
00026       ONEMILLION = 1000000,
00027       ONEBILLION = 1000000000,
00028       };
00029 
00030   private:
00031     pthread_cond_t  m_condEvent;
00032     pthread_mutex_t m_mutexEvent;
00033     pthread_mutex_t m_mutexSignal;
00034     bool m_bSignaled;
00035     bool m_bAutoSignal;   //does the signal get set back to unsignaled once wait has completed?
00036 
00037   public:
00038     CMclEvent(bool bAutoSignal=true);
00039     virtual ~CMclEvent();
00040 
00041     // operations on event object...
00042     DWORD Wait(DWORD dwTime=INFINITE);      //time in milliseconds
00043     BOOL Set(void);
00044     BOOL Reset(void);
00045     BOOL Pulse(void);
00046 
00047   private:
00048     void autoResetSignal();
00049 };
00050 
00051 };
00052 
00053 #endif  //__CMCLEVENT_H__

Generated on Thu Nov 8 12:39:25 2001 for SimpleServerObjects by doxygen1.2.11 written by Dimitri van Heesch, © 1997-2001