2 * w32semaphore-win32.c: Runtime support for managed Semaphore on Win32
5 * Ludovic Henry (luhenry@microsoft.com)
7 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
10 #include "w32semaphore.h"
16 mono_w32semaphore_init (void)
21 ves_icall_System_Threading_Semaphore_CreateSemaphore_internal (gint32 initialCount, gint32 maximumCount, MonoString *name, gint32 *error)
25 sem = CreateSemaphore (NULL, initialCount, maximumCount, name ? mono_string_chars (name) : NULL);
27 *error = GetLastError ();
33 ves_icall_System_Threading_Semaphore_ReleaseSemaphore_internal (gpointer handle, gint32 releaseCount, gint32 *prevcount)
35 return ReleaseSemaphore (handle, releaseCount, prevcount);
39 ves_icall_System_Threading_Semaphore_OpenSemaphore_internal (MonoString *name, gint32 rights, gint32 *error)
43 sem = OpenSemaphore (rights, FALSE, mono_string_chars (name));
45 *error = GetLastError ();