static gboolean test_and_own (guint32 numobjects, gpointer *handles, gboolean waitall, guint32 *count, guint32 *lowest) { gboolean done; int i; MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: locking handles", __func__); done = _wapi_handle_count_signalled_handles (numobjects, handles, waitall, count, lowest); if (done == TRUE) { if (waitall == TRUE) { for (i = 0; i < numobjects; i++) { own_if_signalled (handles[i]); } } else { own_if_signalled (handles[*lowest]); } } MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: unlocking handles", __func__); _wapi_handle_unlock_handles (numobjects, handles); return(done); }
static void handle_cleanup (void *data) { struct handle_cleanup_data *handles = (struct handle_cleanup_data *)data; _wapi_handle_unlock_handles (handles->numobjects, handles->handles); }