-/*
- * mono-os-semaphore.h: Definitions for generic semaphore usage
+/**
+ * \file
+ * Definitions for generic semaphore usage
*
* Author:
* Geoff Norton <gnorton@novell.com>
#elif !defined(HOST_WIN32) && defined(HAVE_SEMAPHORE_H)
#include <semaphore.h>
#else
-#include <winsock2.h>
-#include <windows.h>
+#include <mono/utils/mono-os-wait.h>
#endif
#define MONO_HAS_SEMAPHORES 1
BOOL res;
retry:
- res = WaitForSingleObjectEx (*sem, timeout_ms, flags & MONO_SEM_FLAGS_ALERTABLE);
+ res = mono_win32_wait_for_single_object_ex (*sem, timeout_ms, flags & MONO_SEM_FLAGS_ALERTABLE);
if (G_UNLIKELY (res != WAIT_OBJECT_0 && res != WAIT_IO_COMPLETION && res != WAIT_TIMEOUT))
- g_error ("%s: WaitForSingleObjectEx failed with error %d", __func__, GetLastError ());
+ g_error ("%s: mono_win32_wait_for_single_object_ex failed with error %d", __func__, GetLastError ());
if (res == WAIT_IO_COMPLETION && !(flags & MONO_SEM_FLAGS_ALERTABLE))
goto retry;
static inline int
mono_os_sem_wait (MonoSemType *sem, MonoSemFlags flags)
{
- return mono_os_sem_timedwait (sem, INFINITE, flags) != 0 ? -1 : 0;
+ return mono_os_sem_timedwait (sem, MONO_INFINITE_WAIT, flags) != 0 ? -1 : 0;
}
static inline void