From: Vadim Zeitlin Date: Thu, 10 Jul 2003 16:23:42 +0000 (+0000) Subject: fix for IsAlive() called after Kill() or Exit() X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/57fd9bb2394e62823417e6068f81a5afdbd47d92 fix for IsAlive() called after Kill() or Exit() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21870 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 576f756780..86bd337e1b 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -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);