3 * Runtime support for managed Mutex on Win32
6 * Ludovic Henry (luhenry@microsoft.com)
8 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
17 mono_w32mutex_init (void)
22 ves_icall_System_Threading_Mutex_CreateMutex_internal (MonoBoolean owned, MonoString *name, MonoBoolean *created)
29 mutex = CreateMutex (NULL, owned, NULL);
31 mutex = CreateMutex (NULL, owned, mono_string_chars (name));
33 if (GetLastError () == ERROR_ALREADY_EXISTS)
41 ves_icall_System_Threading_Mutex_ReleaseMutex_internal (gpointer handle)
43 return ReleaseMutex (handle);
47 ves_icall_System_Threading_Mutex_OpenMutex_internal (MonoString *name, gint32 rights, gint32 *error)
51 *error = ERROR_SUCCESS;
53 ret = OpenMutex (rights, FALSE, mono_string_chars (name));
55 *error = GetLastError ();