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

Last change on this file since 7491 was 4105, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 598 bytes
Line 
1#ifndef COSY_MThread
2#define COSY_MThread
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, int prio=0);
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.