aboutsummaryrefslogtreecommitdiff
path: root/lib/base/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/base/thread.h')
-rw-r--r--lib/base/thread.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/base/thread.h b/lib/base/thread.h
new file mode 100644
index 00000000..56b74bed
--- /dev/null
+++ b/lib/base/thread.h
@@ -0,0 +1,23 @@
+#ifndef __lib_base_thread_h
+#define __lib_base_thread_h
+
+#include <pthread.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 kill();
+};
+
+#endif