-
- MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Checking ownership of named mutex handle %p", __func__,
- handle);
-
- if (namedmutex_handle->recursion == 0) {
- MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Named mutex handle %p not owned", __func__,
- handle);
- } else if (namedmutex_handle->pid == _wapi_getpid ()) {
- MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Named mutex handle %p owned by this process",
- __func__, handle);
- } else {
- int thr_ret;
- gpointer proc_handle;
-
- MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Named mutex handle %p owned by another process", __func__, handle);
- proc_handle = OpenProcess (0, 0, namedmutex_handle->pid);
- if (proc_handle == NULL) {
- /* Didn't find the process that this handle
- * was owned by, overriding it
- */
- MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: overriding old owner of named mutex handle %p", __func__, handle);
- thr_ret = _wapi_handle_lock_shared_handles ();
- g_assert (thr_ret == 0);
-
- namedmutex_handle->pid = 0;
- namedmutex_handle->tid = 0;
- namedmutex_handle->recursion = 0;
-
- _wapi_shared_handle_set_signal_state (handle, TRUE);
- _wapi_handle_unlock_shared_handles ();
- } else {
- MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Found active pid %d for named mutex handle %p", __func__, namedmutex_handle->pid, handle);
- }
- if (proc_handle != NULL)
- CloseProcess (proc_handle);
- }
+
+ MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: pre-waiting %s handle %p, owned? %s",
+ __func__, mutex_handle_type_to_string (type), handle, mutex_handle->recursion != 0 ? "true" : "false");