Main Page   Packages   Class Hierarchy   Alphabetical List   Data Structures   File List   Namespace Members   Data Fields   Globals  

Mutex.h

Go to the documentation of this file.
00001 /*
00002  * $Id: Mutex.h,v 1.3 2002/07/08 04:58:12 mindstorm2600 Exp $
00003  */
00009  /*
00010  * $Log: Mutex.h,v $
00011  * Revision 1.3  2002/07/08 04:58:12  mindstorm2600
00012  * Adding every class to the clawsoft namespace
00013  *
00014  * Revision 1.2  2002/07/06 04:47:44  mindstorm2600
00015  * Adding more documentation
00016  *
00017  * Revision 1.1  2002/07/06 03:31:27  mindstorm2600
00018  * Filenames and classnames changed succesfully
00019  *
00020  * Revision 1.5  2002/07/02 02:55:23  mindstorm2600
00021  * Fixing a few documentation discrepancies
00022  *
00023  * Revision 1.4  2002/07/01 04:15:33  mindstorm2600
00024  * Adding an appropiated destructor and the requested exceptions
00025  *
00026  * Revision 1.3  2002/07/01 03:37:48  mindstorm2600
00027  * Adding more thread abstraction, now using SDL's threads interface
00028  *
00029  * Revision 1.2  2002/06/26 05:48:30  mindstorm2600
00030  * cambie el nombre de la clase
00031  *
00032  * Revision 1.1  2002/06/26 05:45:50  mindstorm2600
00033  * These are the thread synchronization classes
00034  *
00035  */
00036 #ifndef ___MUTEX_H__
00037 #define ___MUTEX_H__
00038 
00039 #ifdef USE_GNUPTH
00040 #include<pth.h>
00041 #else
00042 #include<SDL/SDL.h>
00043 #endif
00044 #include<Exception.h>
00045 #include<Object.h>
00046 namespace clawsoft{
00047 
00048 
00052         class Mutex:public Object{
00053          private:
00055         #ifdef USE_GNUPTH
00056           pth_mutex_t mutex;
00057         #else
00058           SDL_mutex *mutex;
00059         #endif
00060 
00064           void destroy();
00065          public:
00071           Mutex(int autoinit = 1);
00076           ~Mutex(){
00077                   destroy();
00078           }
00079         
00084           void init();
00085         
00089           void lock();
00090         
00094           void unlock();
00095         };
00096 
00097 };
00098 
00099 #endif

Powered by:

SourceForge Logo