source: trunk/MagicSoft/Cosy/base/MThread.h@ 1208

Last change on this file since 1208 was 1111, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 580 bytes
Line 
1#ifndef MTHREAD_H
2#define MTHREAD_H
3
4#ifdef __CINT__
5typedef unsigned long int pthread_t;
6#else
7#include <pthread.h>
8#endif
9
10class MThread
11{
12private:
13 bool fIsRunning;
14 bool fIsDetached;
15 bool fStop;
16
17 pthread_t *fThread;
18
19 void *fReturn;
20
21 int fPriority;
22
23 static void *MapThread(void *arg);
24 void *RunThread();
25 virtual void *Thread() = 0;
26
27public:
28 MThread(bool start=true);
29 virtual ~MThread();
30
31 bool SetPriority(int prio);
32
33 void Detach();
34
35 void Start();
36 void Stop();
37
38 bool HasStopFlag() const { return fStop; }
39};
40
41#endif
Note: See TracBrowser for help on using the repository browser.