diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-02-24 14:44:50 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-02-24 14:44:50 +0000 |
commit | 6d6284c9e6d1e3d1f0083c153ee21235771e1014 (patch) | |
tree | 32ab7da6461deb5264075e4221fb1f2aa6e666a0 /os/rt/include/chthreads.h | |
parent | a2072b5560adf07640b43107e00582b31658540d (diff) | |
download | ChibiOS-6d6284c9e6d1e3d1f0083c153ee21235771e1014.tar.gz ChibiOS-6d6284c9e6d1e3d1f0083c153ee21235771e1014.tar.bz2 ChibiOS-6d6284c9e6d1e3d1f0083c153ee21235771e1014.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8941 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/include/chthreads.h')
-rw-r--r-- | os/rt/include/chthreads.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/os/rt/include/chthreads.h b/os/rt/include/chthreads.h index 8d632d59e..d4f2a68d0 100644 --- a/os/rt/include/chthreads.h +++ b/os/rt/include/chthreads.h @@ -182,6 +182,7 @@ extern "C" { tprio_t prio, tfunc_t pf, void *arg);
thread_t *chThdStart(thread_t *tp);
tprio_t chThdSetPriority(tprio_t newprio);
+ void chThdTerminate(thread_t *tp);
msg_t chThdSuspendS(thread_reference_t *trp);
msg_t chThdSuspendTimeoutS(thread_reference_t *trp, systime_t timeout);
void chThdResumeI(thread_reference_t *trp, msg_t msg);
@@ -277,6 +278,19 @@ static inline bool chThdTerminatedX(thread_t *tp) { }
/**
+ * @brief Verifies if the current thread has a termination request pending.
+ *
+ * @retval true termination request pending.
+ * @retval false termination request not pending.
+ *
+ * @xclass
+ */
+static inline bool chThdShouldTerminateX(void) {
+
+ return (bool)((chThdGetSelfX()->flags & CH_FLAG_TERMINATE) != (tmode_t)0);
+}
+
+/**
* @brief Resumes a thread created with @p chThdCreateI().
*
* @param[in] tp pointer to the thread
|