--- /dev/null
+/*
+This file is part of libmspframework
+Copyright © 2006 Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+#ifndef MSP_FRAMEWORK_THREAD_H_
+#define MSP_FRAMEWORK_THREAD_H_
+
+#include <pthread.h>
+
+namespace Msp {
+
+class Thread
+{
+public:
+ void *join();
+ void kill(int s) { pthread_kill(thread_, s); }
+ virtual ~Thread();
+protected:
+ Thread() { }
+ void launch() { pthread_create(&thread_, 0, &main_, this); }
+ virtual void *main()=0;
+ void exit(void *r) { pthread_exit(r); }
+private:
+ pthread_t thread_;
+
+ Thread(const Thread &);
+ Thread &operator=(const Thread &);
+
+ static void *main_(void *t) { return ((Thread *)t)->main(); }
+};
+
+} // namespace Msp
+
+#endif