fix main thread

This commit is contained in:
NIIBE Yutaka
2013-06-12 16:04:07 +09:00
parent 4dde668afb
commit fc75a46a8d
2 changed files with 11 additions and 2 deletions

View File

@@ -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.

View File

@@ -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;
}