| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
#ifndef __threadlinux_h__ |
| 15 |
#define __threadlinux_h__ |
| 16 |
|
| 17 |
#include "thread.h" |
| 18 |
|
| 19 |
#include <stdlib.h> |
| 20 |
#include <unistd.h> |
| 21 |
#include <limits.h> |
| 22 |
#include <sys/wait.h> |
| 23 |
#include <sys/types.h> |
| 24 |
#include <pthread.h> |
| 25 |
|
| 26 |
class THREAD_LINUX : public THREAD |
| 27 |
{ |
| 28 |
public: |
| 29 |
|
| 30 |
|
| 31 |
virtual void start(THREADmainFunc func, void *data); |
| 32 |
|
| 33 |
|
| 34 |
virtual void join(); |
| 35 |
|
| 36 |
|
| 37 |
virtual void kill(); |
| 38 |
|
| 39 |
THREAD_LINUX(); |
| 40 |
virtual ~THREAD_LINUX(); |
| 41 |
protected: |
| 42 |
|
| 43 |
virtual void waittillimready(); |
| 44 |
virtual void iamdonenow(); |
| 45 |
virtual void jobsready(); |
| 46 |
|
| 47 |
pthread_t mySelf; |
| 48 |
pthread_mutex_t myLock; |
| 49 |
pthread_cond_t myStateChangeEvent; |
| 50 |
bool myRunning; |
| 51 |
bool myExists; |
| 52 |
}; |
| 53 |
|
| 54 |
#endif |
| 55 |
|