Beispiel #1
0
void
sgen_bridge_processing_finish (int generation)
{
	bridge_processor.processing_build_callback_data (generation);
	if (compare_bridge_processors ())
		compare_to_bridge_processor.processing_build_callback_data (generation);

	if (bridge_processor.num_sccs == 0) {
		g_assert (bridge_processor.num_xrefs == 0);
		goto after_callback;
	}

	bridge_callbacks.cross_references (bridge_processor.num_sccs, bridge_processor.api_sccs,
			bridge_processor.num_xrefs, bridge_processor.api_xrefs);

	if (compare_bridge_processors ())
		sgen_compare_bridge_processor_results (&bridge_processor, &compare_to_bridge_processor);

	null_weak_links_to_dead_objects (&bridge_processor, generation);

	free_callback_data (&bridge_processor);
	if (compare_bridge_processors ())
		free_callback_data (&compare_to_bridge_processor);

 after_callback:
	bridge_processor.processing_after_callback (generation);
	if (compare_bridge_processors ())
		compare_to_bridge_processor.processing_after_callback (generation);

	bridge_processing_in_progress = FALSE;
}
Beispiel #2
0
void
sgen_bridge_processing_finish (int generation)
{
	bridge_processor.processing_build_callback_data (generation);
	if (compare_bridge_processors ())
		compare_to_bridge_processor.processing_build_callback_data (generation);

	if (bridge_processor.num_sccs == 0) {
		g_assert (bridge_processor.num_xrefs == 0);
		goto after_callback;
	}

	bridge_callbacks.cross_references (bridge_processor.num_sccs, bridge_processor.api_sccs,
			bridge_processor.num_xrefs, bridge_processor.api_xrefs);

	if (compare_bridge_processors ())
		sgen_compare_bridge_processor_results (&bridge_processor, &compare_to_bridge_processor);

	null_weak_links_to_dead_objects (&bridge_processor, generation);

	free_callback_data (&bridge_processor);
	if (compare_bridge_processors ())
		free_callback_data (&compare_to_bridge_processor);

 after_callback:
	bridge_processor.processing_after_callback (generation);
	if (compare_bridge_processors ())
		compare_to_bridge_processor.processing_after_callback (generation);

	mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_BRIDGE: Complete, was running for %.2fms", mono_time_since_last_stw () / 10000.0f);

	bridge_processing_in_progress = FALSE;
}
Beispiel #3
0
static int
sendfile_close_cb (eio_req *req)
{
	callback_data_t *data = (callback_data_t *) req->data;

	data->cb (data->gchandle, data->length, 0);

	free_callback_data (data);
	return 0;
}
Beispiel #4
0
static int
file_get_length_stat_cb (eio_req *req)
{
	struct stat *buf = EIO_STAT_BUF (req);
	callback_data_t *data = (callback_data_t *) req->data;

	data->cb (data->gchandle, buf->st_size, 0);

	free_callback_data (data);
	return 0;
}
Beispiel #5
0
void
sgen_bridge_processing_finish (int generation)
{
	unsigned long step_8;
	SGEN_TV_DECLARE (atv);
	SGEN_TV_DECLARE (btv);

	bridge_processor.processing_build_callback_data (generation);
	if (compare_bridge_processors ())
		compare_to_bridge_processor.processing_build_callback_data (generation);

	if (bridge_processor.num_sccs == 0) {
		g_assert (bridge_processor.num_xrefs == 0);
		goto after_callback;
	}

	bridge_callbacks.cross_references (bridge_processor.num_sccs, bridge_processor.api_sccs,
			bridge_processor.num_xrefs, bridge_processor.api_xrefs);

	if (compare_bridge_processors ())
		sgen_compare_bridge_processor_results (&bridge_processor, &compare_to_bridge_processor);

	SGEN_TV_GETTIME (btv);

	null_weak_links_to_dead_objects (&bridge_processor, generation);

	free_callback_data (&bridge_processor);
	if (compare_bridge_processors ())
		free_callback_data (&compare_to_bridge_processor);

	SGEN_TV_GETTIME (atv);
	step_8 = SGEN_TV_ELAPSED (btv, atv);

 after_callback:
	bridge_processor.processing_after_callback (generation);
	if (compare_bridge_processors ())
		compare_to_bridge_processor.processing_after_callback (generation);

	bridge_processing_in_progress = FALSE;
}
static gint
actually_dispatch_callback (gpointer data)
{
	GnomeVFSMonitorHandle *monitor_handle = data;
	GnomeVFSMonitorCallbackData *callback_data;
	gchar *uri;
	GList *l, *next;
	GList *dispatch;
	time_t now;

	/* This function runs on the main loop, so it won't reenter,
	 * although other threads may add stuff to the pending queue
	 * while we don't have the lock
	 */

	time (&now);

	G_LOCK (handle_hash);

	/* Mark this so that do_cancel doesn't free the handle while
	 * we run without the lock during dispatch */
	monitor_handle->in_dispatch = TRUE;
	
	if (!monitor_handle->cancelled) {
		/* Find all callbacks that needs to be dispatched */
		dispatch = NULL;
		l = monitor_handle->pending_callbacks->head;
		while (l != NULL) {
			callback_data = l->data;
			
			g_assert (callback_data->send_state != CALLBACK_STATE_SENDING);

			if (callback_data->send_state == CALLBACK_STATE_NOT_SENT &&
			    callback_data->send_at <= now) {
				callback_data->send_state = CALLBACK_STATE_SENDING;
				dispatch = g_list_prepend (dispatch, callback_data);
			}

			l = l->next;
		}

		dispatch = g_list_reverse (dispatch);
		
		G_UNLOCK (handle_hash);
		
		l = dispatch;
		while (l != NULL) {
			callback_data = l->data;
			
			uri = gnome_vfs_uri_to_string 
				(monitor_handle->uri, 
				 GNOME_VFS_URI_HIDE_NONE);


			/* actually run app code */
			monitor_handle->callback (monitor_handle, uri,
						  callback_data->info_uri, 
						  callback_data->event_type,
						  monitor_handle->user_data);
			
			g_free (uri);
			callback_data->send_state = CALLBACK_STATE_SENT;

			l = l->next;
		}
			
		g_list_free (dispatch);
		
		G_LOCK (handle_hash);

		l = monitor_handle->pending_callbacks->head;
		while (l != NULL) {
			callback_data = l->data;
			next = l->next;
			
			g_assert (callback_data->send_state != CALLBACK_STATE_SENDING);

			/* If we've sent the event, and its not affecting coming events, free it */
			if (callback_data->send_state == CALLBACK_STATE_SENT &&
			    callback_data->send_at + CONSECUTIVE_CALLBACK_DELAY <= now) {
				/* free the callback_data */
				free_callback_data (callback_data);
				
				g_queue_delete_link (monitor_handle->pending_callbacks, l);
			}

			l = next;
		}

	}

	monitor_handle->in_dispatch = FALSE;
	
	/* if we were waiting for this callback to be dispatched
	 * to free this monitor, then do it now. */
	if (monitor_handle->cancelled) {
		destroy_monitor_handle (monitor_handle);
	} else if (no_live_callbacks (monitor_handle)) {
		monitor_handle->pending_timeout = 0;
		monitor_handle->min_send_at = 0;
	} else {
		/* pending callbacks left, install another timeout */
		monitor_handle->min_send_at = get_min_send_at (monitor_handle->pending_callbacks);
		install_timeout (monitor_handle, now);
	}

	G_UNLOCK (handle_hash);

	return FALSE;
}