示例#1
0
struct mm_timeq *
mm_timeq_create(mm_arena_t arena)
{
	struct mm_timeq *timeq = mm_arena_alloc(arena, sizeof(struct mm_timeq));

	mm_list_prepare(&timeq->fe);

	timeq->t1 = NULL;
	timeq->t1_start = MM_TIMEVAL_MIN;
	timeq->t1_width = 0;
	timeq->t1_count = 0;
	timeq->t1_index = 0;

	mm_list_prepare(&timeq->t2);
	timeq->t2_start = MM_TIMEVAL_MIN;
	timeq->t2_min = MM_TIMEVAL_MAX;
	timeq->t2_max = MM_TIMEVAL_MIN;
	timeq->t2_num = 0;

	timeq->t1_width_min = MM_TIMEQ_T1_WIDTH_MIN;
	timeq->t1_width_max = 0;
	timeq->t1_count_min = MM_TIMEQ_T1_COUNT_MIN;
	timeq->t1_count_max = 0;

	timeq->arena = arena;

	return timeq;
}
示例#2
0
mm_task_combiner_prepare(struct mm_task_combiner *combiner, const char *name,
			 size_t size, size_t handoff)
{
	ENTER();

	mm_combiner_prepare(&combiner->combiner, size, handoff);

	MM_THREAD_LOCAL_ALLOC(mm_domain_selfptr(), name, combiner->wait_queue);
	for (mm_core_t core = 0; core < mm_core_getnum(); core++) {
		struct mm_list *wait_queue = MM_THREAD_LOCAL_DEREF(core, combiner->wait_queue);
		mm_list_prepare(wait_queue);
	}

	LEAVE();
}