예제 #1
0
파일: sgen-workers.c 프로젝트: bnji/mono
/*
 * Can only be called if the workers are stopped.
 * If we're stopped, there are also no pending jobs.
 */
gboolean
sgen_workers_have_idle_work (void)
{
	int i;

	SGEN_ASSERT (0, forced_stop && sgen_workers_all_done (), "Checking for idle work should only happen if the workers are stopped.");

	if (!sgen_section_gray_queue_is_empty (&workers_distribute_gray_queue))
		return TRUE;

	for (i = 0; i < workers_num; ++i) {
		if (!sgen_gray_object_queue_is_empty (&workers_data [i].private_gray_queue))
			return TRUE;
	}

	return FALSE;
}
예제 #2
0
void
sgen_workers_wait (void)
{
    sgen_thread_pool_idle_wait ();
    SGEN_ASSERT (0, sgen_workers_all_done (), "Why are the workers not done after we wait for them?");
}