summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2013-05-29 13:09:57 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2013-05-29 13:09:57 +0900
commit48ccb4458d9c0f9accc1529fa94d089559aeca59 (patch)
tree065540ab51ecea71114ff1bbf2da7acef8c02a50
parent866461d13ed16354867e0cec1dd4c288ae559c99 (diff)
check RET in _join
-rw-r--r--ChangeLog1
-rw-r--r--chopstx.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 903a8c0..5a0dab4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
(chx_sched): Add an argument for race avoidance.
(chopstx_intr_wait): Fix the race condition.
(chopstx_cond_broadcast): Fix initial value.
+ (chopstx_join): Check RET.
* board/board-olimex-stm32-h103.h (NEUG_ADC_SETTING2_*): Add.
diff --git a/chopstx.c b/chopstx.c
index 5064866..6a81638 100644
--- a/chopstx.c
+++ b/chopstx.c
@@ -1131,7 +1131,8 @@ chopstx_join (chopstx_t thd, void **ret)
}
tp->state = THREAD_FINISHED;
- *ret = (void *)tp->tc.reg[0];
+ if (ret)
+ *ret = (void *)tp->tc.reg[0];
asm volatile ("cpsie i" : : : "memory");
}