X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fthread.h;h=59e6e060ce4b77d2e0e69b45f245e6537ca3a70b;hb=a1d6fa071280123f282c1bac3b68008672401024;hp=8d323b328441896a6c3a928ec51fc560ed84847b;hpb=cfc8e0b7b15ea505bd6a6a9599cbc5ce1e316963;p=libs%2Fcore.git diff --git a/source/core/thread.h b/source/core/thread.h index 8d323b3..59e6e06 100644 --- a/source/core/thread.h +++ b/source/core/thread.h @@ -8,8 +8,6 @@ Distributed under the LGPL #ifndef MSP_CORE_THREAD_H_ #define MSP_CORE_THREAD_H_ -#include "types.h" - namespace Msp { /** @@ -22,33 +20,24 @@ is started. class Thread { private: - ThreadHandle thread_; - bool launched_; + struct Private; + + Private *priv_; + bool launched_; protected: - Thread(): launched_(false) { } + Thread(); +private: + Thread(const Thread &); + Thread &operator=(const Thread &); public: virtual ~Thread(); void join(); - void cancel(); void kill(); protected: void launch(); - virtual void main()=0; - void check_cancel(); - -private: - static -#ifdef WIN32 - DWORD WINAPI -#else - void * -#endif - main_(void *t) { (reinterpret_cast(t))->main(); return 0; } - - Thread(const Thread &); - Thread &operator=(const Thread &); + virtual void main() = 0; }; } // namespace Msp