Changeset 8859 for trunk/MagicSoft/Cosy/videodev/PngReader.h
- Timestamp:
- 02/08/08 22:49:30 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/videodev/PngReader.h
r2278 r8859 1 #ifndef PngReader_H2 #define PngReader_H1 #ifndef COSY_PngReader 2 #define COSY_PngReader 3 3 4 #ifdef __CINT__ 5 typedef unsigned long int pthread_t; 6 struct pthread_mutex_t; 7 struct pthread_cond_t; 8 struct timeval; 9 #else 10 #include <TROOT.h> 11 #include <pthread.h> 12 #include <unistd.h> 13 #include <sys/time.h> 4 #ifndef MARS_MThread 5 #include "MThread.h" 14 6 #endif 15 7 8 #ifndef COSY_PixGetter 16 9 #include "PixGetter.h" 10 #endif 17 11 18 12 class PixClient; 19 13 20 typedef unsigned char byte; 21 22 class PngReader : public PixGetter 14 class PngReader : public PixGetter, public MThread 23 15 { 24 16 private: … … 30 22 static const int gfDepth = 3; 31 23 32 int fStop;33 int fIsRunning;34 35 24 // 36 25 // Thread interface … … 40 29 char fImg[gfCols*gfRows]; 41 30 struct timeval fTime; 42 43 pthread_t fThread;44 31 45 32 PixClient &fClient; … … 53 40 // Execution thread which processes the pictures 54 41 // 55 void Thread(); 56 static void *MapThread(void *arg); 42 Int_t Thread(); 57 43 58 44 public: … … 60 46 virtual ~PngReader(); 61 47 62 // 63 // Starts, stops the execution 64 // 65 void ExitLoop() 66 { 67 fStop = 1; 68 while (IsRunning()) 69 usleep(1); 70 } 71 72 // 73 // flag if the execution is running or not 74 // 75 int IsRunning() const { return fIsRunning; } 48 void ExitLoop() { CancelThread(); } 76 49 77 50 ClassDef(PngReader, 0)
Note:
See TracChangeset
for help on using the changeset viewer.