make wxSemaphore::Post() return wxSEMA_OVERFLOW as documented (patch 1557642)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41593 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user