void thread_block(struct sched_thd *t)
{
	assert(t);
	assert(!sched_thd_member(t));
	fp_rem_thd(t);
	//if (!sched_thd_suspended(t)) fp_rem_thd(t);
}
Esempio n. 2
0
struct sched_thd *schedule(struct sched_thd *t)
{
	struct sched_thd *n;

	assert(!t || !sched_thd_member(t));
	n = fp_get_highest_prio();
	assert(n);
	if (n != t) return n;
	assert(t);
	return fp_get_second_highest_prio(n);
}
struct sched_thd *schedule(struct sched_thd *t)
{
	struct sched_thd *n;

	assert(!t || !sched_thd_member(t));
	/* printc("get the highest_prio ---> "); */
	n = fp_get_highest_prio();
	assert(n);
	if (n != t) return n;
	assert(t);
	/* printc("get the 2nd highest_prio ---> "); */
	return fp_get_second_highest_prio(n);
}
void thread_wakeup(struct sched_thd *t)
{
	assert(t);
	assert(!sched_thd_member(t));
	if (!sched_thd_suspended(t)) fp_add_thd(t, sched_get_metric(t)->priority);
}