X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/57bd4c6031d438f11af0ec540136f49a928b923c..f5766910b6731eb03e82371416e9778203396ce7:/src/msw/thread.cpp diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index b48ed592cd..ee7fec670d 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -355,14 +355,22 @@ wxSemaError wxSemaphoreInternal::Post() { #if !defined(_WIN32_WCE) || (_WIN32_WCE >= 300) if ( !::ReleaseSemaphore(m_semaphore, 1, NULL /* ptr to previous count */) ) -#endif { - wxLogLastError(_T("ReleaseSemaphore")); - - return wxSEMA_MISC_ERROR; + if ( GetLastError() == ERROR_TOO_MANY_POSTS ) + { + return wxSEMA_OVERFLOW; + } + else + { + wxLogLastError(_T("ReleaseSemaphore")); + return wxSEMA_MISC_ERROR; + } } return wxSEMA_NO_ERROR; +#else + return wxSEMA_MISC_ERROR; +#endif } // ----------------------------------------------------------------------------