X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/02761f6cd478e3c2c97cf6f93442747f7b029833..a2351b3fe410cb1b4ea78276658e22af1c36bfc5:/src/msw/thread.cpp diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 462c74137b..ee7fec670d 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -26,6 +26,7 @@ #include "wx/thread.h" #ifndef WX_PRECOMP + #include "wx/msw/missing.h" #include "wx/intl.h" #include "wx/app.h" #include "wx/module.h" @@ -35,7 +36,6 @@ #include "wx/scopeguard.h" #include "wx/msw/private.h" -#include "wx/msw/missing.h" #include "wx/msw/seh.h" #include "wx/except.h" @@ -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 } // ----------------------------------------------------------------------------