diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2013-06-12 16:04:07 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2013-06-12 16:04:07 +0900 |
commit | fc75a46a8de75a71d03d469e71734f0725d6add5 (patch) | |
tree | 0651ca517926760472fc3d522a80996cd4c241c8 | |
parent | 4dde668afbd44ffae98e71778bc50e68cd2fe660 (diff) |
fix main thread
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | chopstx.c | 9 |
2 files changed, 11 insertions, 2 deletions
@@ -1,3 +1,7 @@ +2013-06-12 Niibe Yutaka <gniibe@fsij.org> + + * chopstx.c (chx_init): Inhibit preemption for main thread. + 2013-06-11 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (chx_timer_expired): Use uint16_t here. @@ -724,10 +724,15 @@ chx_init (struct chx_thread *tp) tp->flag_got_cancel = tp->flag_join_req = 0; tp->flag_sched_rr = (CHX_FLAGS_MAIN & CHOPSTX_SCHED_RR)? 1 : 0; tp->flag_detached = (CHX_FLAGS_MAIN & CHOPSTX_DETACHED)? 1 : 0; - tp->prio_orig = tp->prio = CHX_PRIO_MAIN; + tp->prio_orig = CHX_PRIO_MAIN; + tp->prio = 0; tp->v = 0; - running = tp; + + if (CHX_PRIO_MAIN >= CHOPSTX_PRIO_INHIBIT_PREEMPTION) + chx_cpu_sched_lock (); + + tp->prio = CHX_PRIO_MAIN; } |