00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _PTHREADH
00011 #define _PTHREADH
00012
00013
00014 #include <pthread.h>
00015
00016 namespace compp {
00017
00018 class Thread {
00019
00020 private:
00021
00022 protected:
00023
00024 pthread_t PThr_id;
00025 pthread_attr_t *PAttr;
00026
00027 void *Arguments;
00028 void InitPThr();
00029
00030 public:
00031
00032 Thread() ;
00033 virtual ~Thread() ;
00034 Thread(void *arg) ;
00035 bool Start ( void *arg = NULL ) ;
00036 bool Join ( void ** valueptr = NULL );
00037 bool Detach();
00038 bool Terminate();
00039
00040 void * StartThreadFunc( );
00041 virtual void * Run ( void *arg ) =0 ;
00042 };
00043 }
00044
00045 #endif