예제 #1
0
static void
threadpool_clear_queue (ThreadPool *tp, MonoDomain *domain)
{
	MonoObject *obj;
	MonoMList *other;

	other = NULL;
	while (mono_cq_dequeue (tp->queue, &obj)) {
		if (obj == NULL)
			continue;
		if (obj->vtable->domain != domain)
			other = mono_mlist_prepend (other, obj);
		threadpool_jobs_dec (obj);
	}

	while (other) {
		threadpool_append_job (tp, (MonoObject *) mono_mlist_get_data (other));
		other = mono_mlist_next (other);
	}
}
예제 #2
0
파일: threadpool.c 프로젝트: mantasp/mono
static void
threadpool_clear_queue (ThreadPool *tp, MonoDomain *domain)
{
	MonoObject *obj;
	MonoMList *other;
	int domain_count;

	other = NULL;
	domain_count = 0;
	while (mono_cq_dequeue (tp->queue, &obj)) {
		if (obj != NULL && obj->vtable->domain == domain) {
			domain_count++;
			threadpool_jobs_dec (obj);
		} else if (obj != NULL) {
			other = mono_mlist_prepend (other, obj);
		}
	}

	while (other) {
		threadpool_append_job (tp, (MonoObject *) mono_mlist_get_data (other));
		other = mono_mlist_next (other);
	}
}