diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2015-09-11 17:04:28 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2015-09-11 17:04:28 +0900 |
commit | 4705e2fb15ae58cc47a3df100949b07931d53526 (patch) | |
tree | 90abbdc50ab7f33c245f76aff3020f6871da50e8 | |
parent | 14ad39552361815e17ddf9764228a093489555f7 (diff) |
fix cancellation
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | chopstx.c | 6 |
2 files changed, 9 insertions, 2 deletions
@@ -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> * VERSION: 0.09. @@ -637,7 +637,8 @@ chx_init (struct chx_thread *tp) tp->mutex_list = NULL; tp->clp = NULL; 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_detached = (CHX_FLAGS_MAIN & CHOPSTX_DETACHED)? 1 : 0; tp->prio_orig = CHX_PRIO_MAIN_INIT; @@ -817,7 +818,8 @@ chopstx_create (uint32_t flags_and_prio, tp->mutex_list = NULL; tp->clp = NULL; 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_detached = (flags_and_prio & CHOPSTX_DETACHED)? 1 : 0; tp->prio_orig = tp->prio = prio; |