diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2016-05-23 17:45:10 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2016-05-23 17:45:10 +0900 |
commit | 77255b0c1d3272b38e75f76e02830556ec436cb9 (patch) | |
tree | 65b69da6b30a845773bc12ac7810ce063c89c91f | |
parent | eeb354119c0304c935095bed5fc155aa67f7250b (diff) |
Fix chopstx_poll
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | chopstx.c | 5 |
2 files changed, 7 insertions, 0 deletions
@@ -1,5 +1,7 @@ 2016-05-23 NIIBE Yutaka <gniibe@fsij.org> + * chopstx.c (chopstx_poll): Fix a race. Check COUNTER. + * example-cdc/usb-cdc.c (tty_input_char): Include newline. * example-cdc/sample.c: Handle newline. @@ -1801,6 +1801,11 @@ chopstx_poll (uint32_t *usec_p, int n, ...) { chopstx_testcancel (); chx_cpu_sched_lock (); + if (counter) + { + chx_cpu_sched_unlock (); + break; + } r = chx_snooze (THREAD_WAIT_POLL, usec_p); } while (r == 0); |