home *** CD-ROM | disk | FTP | other *** search
/ Geek 6 / Geek-006.iso / linux / video / xmovie-1.5.3.tar.gz / xmovie-1.5.3.tar / xmovie-1.5.3 / guicast / thread.h < prev    next >
C/C++ Source or Header  |  2000-11-29  |  891b  |  35 lines

  1. #ifndef THREAD_H
  2. #define THREAD_H
  3.  
  4. #include <pthread.h>
  5.  
  6. class Thread
  7. {
  8. private:
  9.     static void* entrypoint(void *parameters);
  10. protected:
  11.     virtual void run() = 0;
  12. public:
  13.     Thread(int synchronous = 0, int realtime = 0);
  14.     virtual ~Thread();
  15.     void start();
  16.     int end(pthread_t tid);           // end another thread
  17.     int end();    // end this thread
  18.     int cancel();    // end this thread
  19.     int join();   // join this thread
  20.     int suspend_thread();   // suspend this thread
  21.     int continue_thread();     // continue this thread
  22.     int exit_thread();   // exit this thread
  23.     int set_realtime();          // set to to schedule realtime
  24.     int enable_cancel();
  25.     int disable_cancel();
  26.     int running();           // Return if thread is running
  27.  
  28.     int synchronous;         // set to 1 to force join() to end
  29.     int realtime;            // set to 1 to schedule realtime
  30.     int thread_running;
  31.       pthread_t tid;
  32. };
  33.  
  34. #endif
  35.