#include <stdlib.h>
#include <errno.h>
+#include <WinError.h>
#include <omnithread.h>
#include <process.h>
void
omni_semaphore::post(void)
{
- if (!ReleaseSemaphore(nt_sem, 1, NULL))
+ if (!ReleaseSemaphore(nt_sem, 1, NULL)
+ && GetLastError() != ERROR_TOO_MANY_POSTS ) // MinGW fix--see ticket:95 in trac
throw omni_thread_fatal(GetLastError());
}