static void
thread_own_mutex (MonoInternalThread *internal, gpointer handle)
{
- mono_w32handle_ref (handle);
-
/* if we are not on the current thread, there is a
* race condition when allocating internal->owned_mutexes */
g_assert (mono_thread_internal_is_current (internal));
if (!internal->owned_mutexes)
internal->owned_mutexes = g_ptr_array_new ();
- g_ptr_array_add (internal->owned_mutexes, handle);
+ g_ptr_array_add (internal->owned_mutexes, mono_w32handle_duplicate (handle));
}
static void
removed = g_ptr_array_remove (internal->owned_mutexes, handle);
g_assert (removed);
- mono_w32handle_unref (handle);
+ mono_w32handle_close (handle);
}
static void