X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/22f3361e1cf25c52a2da8fdfc5cb081809e18fb9..819451b6c76bdcaf5fd8865479209859511aa986:/src/msw/thread.cpp?ds=sidebyside diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index cf2353b615..92f34c9ca8 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -267,7 +267,16 @@ public: bool IsOk() const { return m_semaphore != NULL; } wxSemaError Wait() { return WaitTimeout(INFINITE); } - wxSemaError TryWait() { return WaitTimeout(0); } + + wxSemaError TryWait() + { + wxSemaError rc = WaitTimeout(0); + if ( rc == wxSEMA_TIMEOUT ) + rc = wxSEMA_BUSY; + + return rc; + } + wxSemaError WaitTimeout(unsigned long milliseconds); wxSemaError Post(); @@ -321,7 +330,7 @@ wxSemaError wxSemaphoreInternal::WaitTimeout(unsigned long milliseconds) return wxSEMA_NO_ERROR; case WAIT_TIMEOUT: - return wxSEMA_BUSY; + return wxSEMA_TIMEOUT; default: wxLogLastError(_T("WaitForSingleObject(semaphore)")); @@ -665,6 +674,8 @@ bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize) SetPriority(m_priority); } + m_state = STATE_NEW; + return TRUE; }