change poll behavior

This commit is contained in:
NIIBE Yutaka
2016-04-24 12:24:36 +09:00
parent 8668c8a88a
commit a538113c07
2 changed files with 18 additions and 2 deletions

View File

@@ -1104,8 +1104,20 @@ chx_snooze (uint32_t state, uint32_t *usec_p)
if (usec == 0)
{
chx_cpu_sched_unlock ();
return -1;
if (state == THREAD_WAIT_TIME)
{
chx_cpu_sched_unlock ();
return -1;
}
else
{
if (running->flag_sched_rr)
chx_timer_dequeue (running);
running->state = state;
r = chx_sched (CHX_SLEEP);
return r;
}
}
usec0 = (usec > MAX_USEC_FOR_TIMER) ? MAX_USEC_FOR_TIMER: usec;