00001 #ifndef __CMWFWTHREAD_H__ 00002 #define __CMWFWTHREAD_H__ 00003 00004 #include <stdarg.h> //To avoid compiler errors concerning 00005 //undefined routine vprintf used in 00006 //rdaMessageLogger. 00007 //By making sure that stdarg.h is included 00008 //before stdio, no errors occur. 00009 //This is specific to Lynx 00010 #include <JTC/JTC.h> 00011 #include "cmwfwTypes.h" 00012 00013 00014 struct cmwfwThreadComm{ 00015 void* param; 00016 bool stop_flag; 00017 void* thr_exit_status; 00018 }; 00019 00020 00021 class cmwfwThread { 00022 public: 00023 cmwfwThread(void*(*f)(void*),void*); 00024 ~cmwfwThread(); 00025 bool run(); 00026 bool kill(); 00027 bool sendSignal(int); 00028 void* requestStop(); 00029 bool isRunning(); 00030 protected: 00031 private: 00032 bool running; 00033 void* (*thr_routine)(void*); 00034 cmwfwThreadComm thr_param; 00035 JTCThreadHandle theThread; 00036 void heaperr(int line); 00037 }; 00038 00039 00040 class cmwfwActualThread_JTC : public JTCThread { 00041 00042 public: 00043 cmwfwActualThread_JTC(void*(*f)(void*),void* p); 00044 virtual void run(); 00045 private: 00046 void* (*thr_routine)(void*); 00047 void* parameter; 00048 }; 00049 00050 00051 #endif//#ifndef __CMWFWTHREAD_H__