-#ifdef WIN32
- DWORD dummy; // Win9x needs the lpTthreadId parameter
- thread_=CreateThread(0, 0, &main_, this, 0, &dummy);
-#else
- pthread_create(&thread_, 0, &main_, this);
-#endif
- launched_=true;
+ThreadReturn THREAD_CALL Thread::Private::main_wrapper(void *arg)
+{
+ Thread *thread = reinterpret_cast<Thread *>(arg);
+ thread->platform_setname();
+ thread->main();
+ thread->state_ = FINISHED;
+ return 0;