]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for IsAlive() called after Kill() or Exit()
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 10 Jul 2003 16:23:42 +0000 (16:23 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 10 Jul 2003 16:23:42 +0000 (16:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21870 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/thread.cpp

index 576f756780d69566bcec83e6f326cdb16c376c1c..86bd337e1b8b467a59fd9a4059ead471a06921e9 100644 (file)
@@ -1116,6 +1116,12 @@ wxThreadError wxThread::Kill()
     {
         delete this;
     }
+    else // joinable
+    {
+        // update the status of the joinable thread
+        wxCriticalSectionLocker lock(m_critsect);
+        m_internal->SetState(STATE_EXITED);
+    }
 
     return wxTHREAD_NO_ERROR;
 }
@@ -1128,6 +1134,12 @@ void wxThread::Exit(ExitCode status)
     {
         delete this;
     }
+    else // joinable
+    {
+        // update the status of the joinable thread
+        wxCriticalSectionLocker lock(m_critsect);
+        m_internal->SetState(STATE_EXITED);
+    }
 
 #ifdef wxUSE_BEGIN_THREAD
     _endthreadex((unsigned)status);