2 * w32mutex-win32.c: Runtime support for managed Mutex 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.
16 mono_w32mutex_init (void)
21 ves_icall_System_Threading_Mutex_CreateMutex_internal (MonoBoolean owned, MonoString *name, MonoBoolean *created)
28 mutex = CreateMutex (NULL, owned, NULL);
30 mutex = CreateMutex (NULL, owned, mono_string_chars (name));
32 if (GetLastError () == ERROR_ALREADY_EXISTS)
40 ves_icall_System_Threading_Mutex_ReleaseMutex_internal (gpointer handle)
42 return ReleaseMutex (handle);
46 ves_icall_System_Threading_Mutex_OpenMutex_internal (MonoString *name, gint32 rights, gint32 *error)
50 *error = ERROR_SUCCESS;
52 ret = OpenMutex (rights, FALSE, mono_string_chars (name));
54 *error = GetLastError ();