2 This file is part of libmspframework
3 Copyright © 2006 Mikko Rasa, Mikkosoft Productions
4 Distributed under the LGPL
6 #ifndef MSP_FRAMEWORK_THREAD_H_
7 #define MSP_FRAMEWORK_THREAD_H_
10 #include "win32signum.h"
21 void kill(int s) { pthread_kill(thread_, s); }
24 Thread(): valid_(false) { }
25 void launch() { if(!valid_) pthread_create(&thread_, 0, &main_, this); }
26 virtual void *main()=0;
27 void exit(void *r) { pthread_exit(r); }
32 Thread(const Thread &);
33 Thread &operator=(const Thread &);
35 static void *main_(void *t) { return ((Thread *)t)->main(); }