示例#1
0
static void
threadpool_clear_queue (ThreadPool *tp, MonoDomain *domain)
{
	MonoObject *obj;
	MonoMList *other = NULL;
	MonoCQ *queue = tp->queue;

	if (!queue)
		return;

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

	if (mono_runtime_is_shutting_down ())
		return;

	while (other) {
		threadpool_append_job (tp, (MonoObject *) mono_mlist_get_data (other));
		other = mono_mlist_next (other);
	}
}
示例#2
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);
	}
}
示例#3
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);
	}
}