|
|
@@ -70,9 +70,9 @@ bool Thread::Start()
|
|
|
#ifdef _WIN32
|
|
|
handle_ = CreateThread(0, 0, ThreadFunctionStatic, this, 0, 0);
|
|
|
#else
|
|
|
- handle_ = new pthread_t;
|
|
|
- pthread_attr_t type;
|
|
|
- pthread_attr_init(&type);
|
|
|
+ handle_ = new pthread_t;
|
|
|
+ pthread_attr_t type;
|
|
|
+ pthread_attr_init(&type);
|
|
|
pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE);
|
|
|
pthread_create((pthread_t*)handle_, &type, ThreadFunctionStatic, this);
|
|
|
#endif
|
|
|
@@ -88,10 +88,7 @@ void Thread::Stop()
|
|
|
#else
|
|
|
pthread_t* thread = (pthread_t*)handle_;
|
|
|
if (thread)
|
|
|
- {
|
|
|
- pthread_join(thread, 0);
|
|
|
- pthread_destroy(thread);
|
|
|
- }
|
|
|
+ pthread_join(*thread, 0);
|
|
|
delete thread;
|
|
|
#endif
|
|
|
handle_ = 0;
|