From c84fb40aab90add45b61c4031ca6ab4f80bea722 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Fri, 9 Apr 1999 17:31:20 +0000 Subject: [PATCH] * Commented out "delete this;" * Finished threads can be restarted. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2081 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/unix/threadpsx.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index 50e99df2a7..475d0b72b8 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -453,7 +453,9 @@ wxThread::wxThread() wxThreadError wxThread::Create() { - if (p_internal->GetState() != STATE_NEW) + // Maybe we could think about recreate the thread once it has exited. + if (p_internal->GetState() != STATE_NEW && + p_internal->GetState() != STATE_EXITED) return wxTHREAD_RUNNING; // set up the thread attribute: right now, we only set thread priority @@ -668,7 +670,8 @@ void wxThread::Exit(void *status) p_internal->SetState(STATE_EXITED); // delete both C++ thread object and terminate the OS thread object - delete this; + // GL: This is very ugly and buggy ... +// delete this; pthread_exit(status); }