summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2016-04-24 12:24:36 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2016-04-24 12:24:36 +0900
commita538113c07fca84302abbfde7d07d40f8ed5ff9b (patch)
tree3f09289cd82cf7aed8928f9121dd7d9670b15082
parent8668c8a88aeeaad890d956efc7556827e88a3708 (diff)
change poll behavior
-rw-r--r--ChangeLog4
-rw-r--r--chopstx.c16
2 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5fcca76..70c6371 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-04-24 Niibe Yutaka <gniibe@fsij.org>
+
+ * chopstx.c (chx_snooze): Wait forever when it's POLL and usec==0.
+
2016-04-22 Niibe Yutaka <gniibe@fsij.org>
* example-fs-bb48/first-pages.c: Rename from reset.c and merge
diff --git a/chopstx.c b/chopstx.c
index c8bcf77..3cb4c02 100644
--- a/chopstx.c
+++ b/chopstx.c
@@ -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;