MonoW32HandleNamespace sharedns;
};
-static gboolean sem_handle_own (gpointer handle, MonoW32HandleType type)
+static gboolean sem_handle_own (gpointer handle, MonoW32HandleType type, guint32 *statuscode)
{
MonoW32HandleSemaphore *sem_handle;
+ *statuscode = WAIT_OBJECT_0;
+
if (!mono_w32handle_lookup (handle, type, (gpointer *)&sem_handle)) {
g_warning ("%s: error looking up %s handle %p",
__func__, mono_w32handle_ops_typename (type), handle);
ves_icall_System_Threading_Semaphore_ReleaseSemaphore_internal(handle, 1, NULL);
}
-static gboolean sema_own (gpointer handle)
+static gboolean sema_own (gpointer handle, guint32 *statuscode)
{
- return sem_handle_own (handle, MONO_W32HANDLE_SEM);
+ return sem_handle_own (handle, MONO_W32HANDLE_SEM, statuscode);
}
static void namedsema_signal (gpointer handle)
}
/* NB, always called with the shared handle lock held */
-static gboolean namedsema_own (gpointer handle)
+static gboolean namedsema_own (gpointer handle, guint32 *statuscode)
{
- return sem_handle_own (handle, MONO_W32HANDLE_NAMEDSEM);
+ return sem_handle_own (handle, MONO_W32HANDLE_NAMEDSEM, statuscode);
}
static void sema_details (gpointer data)
gchar *utf8_name;
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: creating %s handle, initial %d max %d name \"%s\"",
- __func__, mono_w32handle_ops_typename (MONO_W32HANDLE_NAMEDSEM), initial, max, name);
+ __func__, mono_w32handle_ops_typename (MONO_W32HANDLE_NAMEDSEM), initial, max, (const char*)name);
/* w32 seems to guarantee that opening named objects can't race each other */
mono_w32handle_namespace_lock ();