aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2015-09-11 17:04:28 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2015-09-11 17:04:28 +0900
commit4705e2fb15ae58cc47a3df100949b07931d53526 (patch)
tree90abbdc50ab7f33c245f76aff3020f6871da50e8
parent14ad39552361815e17ddf9764228a093489555f7 (diff)
fix cancellation
-rw-r--r--ChangeLog5
-rw-r--r--chopstx.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index dd2f6ce..91d3cde 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/chopstx.c b/chopstx.c
index bf335bb..07d9854 100644
--- a/chopstx.c
+++ b/chopstx.c
@@ -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;