aboutsummaryrefslogtreecommitdiff
path: root/lib/base/thread.h
blob: 629a96566c566410dfaa9bdc081ecd592723cf10 (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
#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;
public:
	bool thread_running() { return alive; }
	eThread();
	virtual ~eThread();
	
	void run();

	virtual void thread()=0;
	
	void sendSignal(int sig);
	void kill();
};

#endif