chopstx_wakeup_usec_wait
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2013-06-05 Niibe Yutaka <gniibe@fsij.org>
|
||||
|
||||
* chopstx.c (sched, preempt, svc, chx_timer_expired, chx_exit)
|
||||
(chopstx_usec_wait, chopstx_mutex_lock, chopstx_cond_wait)
|
||||
(chopstx_intr_wait, chopstx_join): Implement SCHED_RR.
|
||||
(chopstx_create): Change API.
|
||||
(chopstx_wakeup_usec_wait): New.
|
||||
|
||||
2013-06-04 Niibe Yutaka <gniibe@fsij.org>
|
||||
|
||||
* chopstx.c (AIRCR): New.
|
||||
|
||||
26
chopstx.c
26
chopstx.c
@@ -1187,7 +1187,10 @@ chopstx_join (chopstx_t thd, void **ret)
|
||||
chx_spin_unlock (&q_join.lock);
|
||||
tp->flag_join_req = 1;
|
||||
if (tp->prio < running->prio)
|
||||
tp->prio = running->prio;
|
||||
{
|
||||
tp->prio = running->prio;
|
||||
/*XXX: dequeue and enqueue with new prio. */
|
||||
}
|
||||
chx_sched (CHX_SLEEP);
|
||||
}
|
||||
else
|
||||
@@ -1199,6 +1202,27 @@ chopstx_join (chopstx_t thd, void **ret)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
chopstx_wakeup_usec_wait (chopstx_t thd)
|
||||
{
|
||||
struct chx_thread *tp = (struct chx_thread *)thd;
|
||||
int yield = 0;
|
||||
|
||||
chx_cpu_sched_lock ();
|
||||
if (tp->state == THREAD_WAIT_TIME)
|
||||
{
|
||||
chx_timer_dequeue (tp);
|
||||
chx_ready_enqueue (tp);
|
||||
if (tp->prio > running->prio)
|
||||
yield = 1;
|
||||
}
|
||||
if (yield)
|
||||
chx_sched (CHX_YIELD);
|
||||
else
|
||||
chx_cpu_sched_unlock ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
chopstx_cancel (chopstx_t thd)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user