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

Thread.h

Go to the documentation of this file.
00001 /*
00002  * $Id: Thread.h,v 1.2 2002/07/08 04:58:12 mindstorm2600 Exp $
00003  */
00004 #ifndef ___THREAD_H__
00005 #define ___THREAD_H__
00006 
00007 #include<SDL/SDL.h>
00008 #ifdef USE_GNUPTH
00009 #include<pth.h>
00010 #else
00011 #include "SDL_thread.h"
00012 #endif
00013 #include<Object.h>
00014 #include<Mutex.h>
00015 
00016 namespace clawsoft{
00021         class Thread:public Object{
00022          private:
00023         #ifdef GNU_PTH
00024 
00025           pth_t thread;
00029           static void *runMethod(void *thethread);
00030         #else
00031 
00032           SDL_Thread *thread;
00036           static int runMethod(void *thethread);
00037         #endif
00038          protected:
00040           int _start();
00042           void detach();
00043          public:
00048           bool autodetach;
00050           Thread();
00052           virtual ~Thread(){
00053                   detach();
00054           }
00056           int start();
00061           virtual void *run() = 0;
00065           void killMe();
00066         };
00067 };
00068 
00069 #endif

Powered by:

SourceForge Logo