00001
00002
00003
00004
00005
00006 #ifndef THREAD_H
00007 #define THREAD_H
00008
00009 #include<Mutex.h>
00010
00011 #include<pthread.h>
00012
00018 class Thread
00019 {
00021 friend void *threadFunc(void *obj);
00022
00023 public:
00025 Thread();
00026 virtual ~Thread();
00027
00029 bool isActive();
00030
00032 virtual void *run() = 0;
00033
00035 void *start();
00036
00038 void join();
00039
00040 private:
00042 pthread_t threadId;
00043
00045 bool active;
00046
00048 Mutex mutex;
00049 };
00050 #endif