コード例 #1
0
/*
 * mono_thread_info_exit:
 *
 *   Exit the current thread.
 * This function doesn't return.
 */
void
mono_thread_info_exit (gsize exit_code)
{
#if defined(__native_client__)
	nacl_shutdown_gc_thread();
#endif

	mono_thread_info_detach ();

	mono_threads_platform_exit (0);
}
コード例 #2
0
static gsize WINAPI
inner_start_thread (gpointer data)
{
	CreateThreadData *thread_data;
	MonoThreadInfo *info;
	MonoThreadStart start_routine;
	gpointer start_routine_arg;
	guint32 start_routine_res;
	gint32 priority;
	gsize dummy;

	thread_data = (CreateThreadData*) data;
	g_assert (thread_data);

	start_routine = thread_data->start_routine;
	start_routine_arg = thread_data->start_routine_arg;

	priority = thread_data->priority;

	info = mono_thread_info_attach (&dummy);
	info->runtime_thread = TRUE;

	mono_threads_platform_set_priority (info, priority);

	thread_data->handle = mono_thread_info_duplicate_handle (info);

	mono_coop_sem_post (&thread_data->registered);

	if (InterlockedDecrement (&thread_data->ref) == 0) {
		mono_coop_sem_destroy (&thread_data->registered);
		g_free (thread_data);
	}

	/* thread_data is not valid anymore */
	thread_data = NULL;

	/* Run the actual main function of the thread */
	start_routine_res = start_routine (start_routine_arg);

	mono_threads_platform_exit (start_routine_res);

	g_assert_not_reached ();
}
コード例 #3
0
ファイル: mono-threads.c プロジェクト: razzfazz/mono
/*
 * mono_thread_info_exit:
 *
 *   Exit the current thread.
 * This function doesn't return.
 */
void
mono_thread_info_exit (void)
{
	mono_threads_platform_exit (0);
}