blob: 94cdd47e66c3721c43b27ec0146b8cbad6fff231 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#ifndef __lib_base_thread_h
#define __lib_base_thread_h
#include <pthread.h>
#include <signal.h>
class eThread
{
pthread_t the_thread;
static void *wrapper(void *ptr);
int alive;
static void thread_completed(void *p);
public:
bool thread_running() { return alive; }
eThread();
virtual ~eThread();
void run(int prio=0, int policy=0);
virtual void thread()=0;
virtual void before_set_thread_alive() { }
virtual void thread_finished() { }
void sendSignal(int sig);
void kill(bool sendcancel=false);
};
#endif
|