00001 #ifndef _POSIX_THREAD_H_ 00002 #define _POSIX_THREAD_H_ 00003 00004 #include "OSDependent/OSDependent.h" 00005 #include "OSDependent/Support/Runnable.h" 00006 00007 /* 00008 * Posix implementation of a thread. 00009 */ 00010 class ClassExport PosixThread { 00011 protected: 00012 pthread_t _tid; 00013 Runnable * _runnable; 00014 00015 public: 00016 PosixThread(Runnable *runnable); 00017 ~PosixThread(); 00018 00019 int start(); 00020 int join(); 00021 // added VP 00022 int getId() { return _tid;} 00023 static int getSelfId() { return pthread_self();} 00024 00025 static void sleep(long msec); 00026 static void exit(int exitCode) {}; 00027 }; 00028 00029 #endif // _POSIX_THREAD_H_
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001