00001 #ifndef WIBBLE_SYS_THREAD_H
00002 #define WIBBLE_SYS_THREAD_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <wibble/exception.h>
00025 #include <pthread.h>
00026 #include <signal.h>
00027
00028 namespace wibble {
00029 namespace sys {
00030
00068 class Thread
00069 {
00070 protected:
00071 pthread_t thread;
00072
00077 virtual const char* threadTag() { return "generic"; }
00078
00083 virtual void* main() = 0;
00084
00086 static void* Starter(void* parm);
00087
00088 void testcancel();
00089
00090 public:
00091 virtual ~Thread() {}
00092
00094 void start();
00095
00097 void startDetached();
00098
00100 void* join();
00101
00103 void detach();
00104
00106 void cancel();
00107
00109 void kill(int signal);
00110 };
00111
00112 }
00113 }
00114
00115
00116 #endif