HSCHED: fix endless loop on migrated thred during accounting CPU time

This commit is contained in:
Jan Stoess 2010-06-23 11:20:16 +02:00
parent 6c1d840678
commit 408e097619
1 changed files with 2 additions and 2 deletions

View File

@ -20,13 +20,13 @@ EXTERN_TRACEPOINT(SCHEDULE_IDLE);
INLINE void hs_sched_ktcb_t::account_pass()
{
tcb_t *tcb = addr_to_tcb(this);
while( tcb != get_idle_tcb() )
while (tcb->get_global_id() != IDLETHREAD )
{
ASSERT(tcb->is_local_cpu());
sched_ktcb_t *sktcb = &tcb->sched_state;
TRACEPOINT (SCHEDULE_DETAILS, "account pass %t %U += %d\n",
tcb, sktcb->get_pass(), sktcb->get_stride());
tcb, sktcb->get_pass(), sktcb->get_stride());
sktcb->set_pass(sktcb->get_pass() + sktcb->get_stride());