bug fix of chopstx_usec_wait_var
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
Reference in New Issue
Block a user