aboutsummaryrefslogtreecommitdiffstats
path: root/os/various
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-02-21 08:26:57 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-02-21 08:26:57 +0000
commitadcc51666865020347d364f7b3cad8a622124f7a (patch)
tree518a8c37a8f76a7fd1a9f074642d14e0c62cf9c8 /os/various
parent951efe320c6a035b67c99deae380b351b2e0b9c0 (diff)
downloadChibiOS-adcc51666865020347d364f7b3cad8a622124f7a.tar.gz
ChibiOS-adcc51666865020347d364f7b3cad8a622124f7a.tar.bz2
ChibiOS-adcc51666865020347d364f7b3cad8a622124f7a.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8918 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/various')
-rw-r--r--os/various/cpp_wrappers/ch.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/os/various/cpp_wrappers/ch.cpp b/os/various/cpp_wrappers/ch.cpp
index f827d285a..bb698d675 100644
--- a/os/various/cpp_wrappers/ch.cpp
+++ b/os/various/cpp_wrappers/ch.cpp
@@ -78,13 +78,15 @@ namespace chibios_rt {
chSysHalt("invoked unimplemented method stop()");
}
+#if CH_CFG_USE_EVENTS
void ThreadReference::requestTerminate(void) {
chDbgAssert(thread_ref != NULL,
"not referenced");
- chThdTerminate(thread_ref);
+ chEvtSignal(thread_ref, CH_EVENT_TERMINATE);
}
+#endif
#if CH_CFG_USE_WAITEXIT
msg_t ThreadReference::wait(void) {
@@ -196,10 +198,12 @@ namespace chibios_rt {
chThdExitS(msg);
}
+#if CH_CFG_USE_EVENTS
bool BaseThread::shouldTerminate(void) {
- return chThdShouldTerminateX();
+ return (chEvtGetEventsX() & CH_EVENT_TERMINATE) != 0;
}
+#endif
void BaseThread::sleep(systime_t interval){