bug fix of chopstx_usec_wait_var

This commit is contained in:
NIIBE Yutaka
2013-08-16 11:02:10 +09:00
parent 8447b2ba8e
commit 86ec749d75
2 changed files with 8 additions and 4 deletions

View File

@@ -1,3 +1,8 @@
2013-08-16 Niibe Yutaka <gniibe@fsij.org>
* chopstx.c (chopstx_usec_wait_var): Check usec_p at the beginning
of the loop, bug fix of sched-unlocking from sched-unlocked state.
2013-06-19 Niibe Yutaka <gniibe@fsij.org>
* chopstx.h (CHOPSTX_THREAD_SIZE): New.

View File

@@ -919,6 +919,8 @@ chopstx_usec_wait_var (uint32_t *var)
while (1)
{
chx_cpu_sched_lock ();
if (!usec_p) /* awakened */
break;
*usec_p -= usec0;
usec = *usec_p;
if (usec == 0)
@@ -930,11 +932,8 @@ chopstx_usec_wait_var (uint32_t *var)
running->state = THREAD_WAIT_TIME;
chx_timer_insert (running, usec0);
chx_spin_unlock (&q_timer.lock);
asm ("" : "=r" (usec_p) : "r" (usec_p));
chx_sched (CHX_SLEEP);
if (!usec_p) /* awakened */
break;
asm ("" : "=r" (usec_p) : "r" (usec_p));
}
chx_cpu_sched_unlock ();