attempt to fix race condition between Delete() and Wait()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23700 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2003-09-19 00:19:50 +00:00
parent 3e5175b737
commit 63fa42b3be

View File

@ -599,9 +599,9 @@ wxThreadInternal::WaitForTerminate(bool shouldCancel,
{
if ( shouldCancel )
{
// WinThreadStart() will see it and terminate immediately, no need
// to cancel the thread - but we still need to resume it to let it
// run
// WinThreadStart() will see it and terminate immediately, no
// need to cancel the thread -- but we still need to resume it
// to let it run
m_state = STATE_EXITED;
Resume(); // it knows about STATE_EXITED special case
@ -613,7 +613,11 @@ wxThreadInternal::WaitForTerminate(bool shouldCancel,
// shouldResume is correctly set to FALSE here
}
else
else if ( m_state == STATE_EXITED )
{
return wxTHREAD_NOT_RUNNING;
}
else // running (but maybe paused or cancelled)
{
shouldResume = m_state == STATE_PAUSED;
}