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 : mclcritsec.cpp
00009 author : Lee Patterson (lee@antws.com)
00010
00011 purpose : Supplies functionality found in MclThread win32 libs. Not all
00012 functionality has been brought across. The critical section
00013 is impliemented as a mutex as Linux doesn't have a kernel
00014 CRITICAL section. This is to maintain compatibility with
00015 existing code.
00016 *********************************************************************/
00017
00018 #ifndef __CMCLCRITSEC_H__
00019 #define __CMCLCRITSEC_H__
00020
00021
00022 # include <pthread.h>
00023
00024 namespace ssobjects
00025 {
00026
00027 class CMclCritSec
00028 {
00029 public:
00030 CMclCritSec();
00031 CMclCritSec(const CMclCritSec&);
00032 virtual ~CMclCritSec();
00033
00034 CMclCritSec& operator=(const CMclCritSec& c);
00035
00036 void Enter(void);
00037 void Leave(void);
00038
00039
00040 private:
00041 pthread_mutex_t m_mutexCritSec;
00042 };
00043
00044 };
00045
00046 #endif
00047