diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2013-08-16 11:02:10 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2013-08-16 11:02:10 +0900 |
commit | 86ec749d755ad54254778596805bf5a71cdc2bbb (patch) | |
tree | ee2dfbadd835f3b989425020855374041508457a | |
parent | 8447b2ba8e7caf10f0c986f629bf457d3db7c5e7 (diff) |
bug fix of chopstx_usec_wait_var
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | chopstx.c | 7 |
2 files changed, 8 insertions, 4 deletions
@@ -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 (); |