fix cancellation

This commit is contained in:
NIIBE Yutaka
2015-09-11 17:04:28 +09:00
parent 14ad395523
commit 4705e2fb15
2 changed files with 9 additions and 2 deletions

View File

@@ -1,3 +1,8 @@
2015-09-11 Niibe Yutaka <gniibe@fsij.org>
* chopstx.c (chx_init, chopstx_create): Fix the initial value
of flag_cancelable.
2015-09-10 Niibe Yutaka <gniibe@fsij.org> 2015-09-10 Niibe Yutaka <gniibe@fsij.org>
* VERSION: 0.09. * VERSION: 0.09.

View File

@@ -637,7 +637,8 @@ chx_init (struct chx_thread *tp)
tp->mutex_list = NULL; tp->mutex_list = NULL;
tp->clp = NULL; tp->clp = NULL;
tp->state = THREAD_RUNNING; tp->state = THREAD_RUNNING;
tp->flag_got_cancel = tp->flag_join_req = tp->flag_cancelable = 0; tp->flag_got_cancel = tp->flag_join_req = 0;
tp->flag_cancelable = 1;
tp->flag_sched_rr = (CHX_FLAGS_MAIN & CHOPSTX_SCHED_RR)? 1 : 0; tp->flag_sched_rr = (CHX_FLAGS_MAIN & CHOPSTX_SCHED_RR)? 1 : 0;
tp->flag_detached = (CHX_FLAGS_MAIN & CHOPSTX_DETACHED)? 1 : 0; tp->flag_detached = (CHX_FLAGS_MAIN & CHOPSTX_DETACHED)? 1 : 0;
tp->prio_orig = CHX_PRIO_MAIN_INIT; tp->prio_orig = CHX_PRIO_MAIN_INIT;
@@ -817,7 +818,8 @@ chopstx_create (uint32_t flags_and_prio,
tp->mutex_list = NULL; tp->mutex_list = NULL;
tp->clp = NULL; tp->clp = NULL;
tp->state = THREAD_EXITED; tp->state = THREAD_EXITED;
tp->flag_got_cancel = tp->flag_join_req = tp->flag_cancelable = 0; tp->flag_got_cancel = tp->flag_join_req = 0;
tp->flag_cancelable = 1;
tp->flag_sched_rr = (flags_and_prio & CHOPSTX_SCHED_RR)? 1 : 0; tp->flag_sched_rr = (flags_and_prio & CHOPSTX_SCHED_RR)? 1 : 0;
tp->flag_detached = (flags_and_prio & CHOPSTX_DETACHED)? 1 : 0; tp->flag_detached = (flags_and_prio & CHOPSTX_DETACHED)? 1 : 0;
tp->prio_orig = tp->prio = prio; tp->prio_orig = tp->prio = prio;