Ignore:
Timestamp:
02/08/08 22:49:30 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/videodev/PngReader.h

    r2278 r8859  
    1 #ifndef PngReader_H
    2 #define PngReader_H
     1#ifndef COSY_PngReader
     2#define COSY_PngReader
    33
    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"
    146#endif
    157
     8#ifndef COSY_PixGetter
    169#include "PixGetter.h"
     10#endif
    1711
    1812class PixClient;
    1913
    20 typedef unsigned char byte;
    21 
    22 class PngReader : public PixGetter
     14class PngReader : public PixGetter, public MThread
    2315{
    2416private:
     
    3022    static const int gfDepth = 3;
    3123
    32     int fStop;
    33     int fIsRunning;
    34 
    3524    //
    3625    // Thread interface
     
    4029    char fImg[gfCols*gfRows];
    4130    struct timeval fTime;
    42 
    43     pthread_t fThread;
    4431
    4532    PixClient &fClient;
     
    5340    // Execution thread which processes the pictures
    5441    //
    55     void Thread();
    56     static void *MapThread(void *arg);
     42    Int_t Thread();
    5743
    5844public:
     
    6046    virtual ~PngReader();
    6147
    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(); }
    7649
    7750    ClassDef(PngReader, 0)
Note: See TracChangeset for help on using the changeset viewer.