From dfc69c6d5bd613a20a9cb815622167a258d4a623 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 23 Dec 2005 01:20:38 +0000 Subject: [PATCH] corrected handling of timeouts in wxConditionInternal::WaitTimeout(): check for wxSEMA_TIMEOUT, not wxSEMA_BUSY; return wxCOND_TIMEOUT, not wxCOND_MISC_ERROR (bug 1387179) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/thrimpl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/wx/thrimpl.cpp b/include/wx/thrimpl.cpp index d0cf9fd610..54f6dd2bfd 100644 --- a/include/wx/thrimpl.cpp +++ b/include/wx/thrimpl.cpp @@ -148,7 +148,7 @@ wxCondError wxConditionInternal::WaitTimeout(unsigned long milliseconds) wxSemaError err = m_semaphore.WaitTimeout(milliseconds); - if ( err == wxSEMA_BUSY ) + if ( err == wxSEMA_TIMEOUT ) { // another potential race condition exists here it is caused when a // 'waiting' thread timesout, and returns from WaitForSingleObject, but @@ -174,7 +174,9 @@ wxCondError wxConditionInternal::WaitTimeout(unsigned long milliseconds) m_mutex.Lock(); - return err == wxSEMA_NO_ERROR ? wxCOND_NO_ERROR : wxCOND_MISC_ERROR; + return err == wxSEMA_NO_ERROR ? wxCOND_NO_ERROR + : err == wxSEMA_TIMEOUT ? wxCOND_TIMEOUT + : wxCOND_MISC_ERROR; } wxCondError wxConditionInternal::Signal() -- 2.45.2