3 This file is part of libmspcore
4 Copyright © 2006 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
18 struct Thread::Private
26 Private(): handle(0) { }
29 static DWORD WINAPI main_wrapper(void *t)
30 { reinterpret_cast<Thread *>(t)->main(); return 0; }
32 static void *main_wrapper(void *t)
33 { reinterpret_cast<Thread *>(t)->main(); return 0; }
54 Waits for the thread to exit. Calling this from the thread will cause a
63 WaitForSingleObject(priv_->handle, INFINITE);
65 pthread_join(priv_->handle, 0);
71 Violently terminates the thread.
76 TerminateThread(priv_->handle, 0);
78 pthread_kill(priv_->handle, SIGKILL);
88 DWORD dummy; // Win9x needs the lpTthreadId parameter
89 priv_->handle = CreateThread(0, 0, &Private::main_wrapper, this, 0, &dummy);
91 pthread_create(&priv_->handle, 0, &Private::main_wrapper, this);