aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-02-24 14:44:50 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-02-24 14:44:50 +0000
commit6d6284c9e6d1e3d1f0083c153ee21235771e1014 (patch)
tree32ab7da6461deb5264075e4221fb1f2aa6e666a0 /os/rt/include
parenta2072b5560adf07640b43107e00582b31658540d (diff)
downloadChibiOS-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')
-rw-r--r--os/rt/include/chdynamic.h4
-rw-r--r--os/rt/include/chevents.h8
-rw-r--r--os/rt/include/chthreads.h14
3 files changed, 16 insertions, 10 deletions
diff --git a/os/rt/include/chdynamic.h b/os/rt/include/chdynamic.h
index fa42bf3ae..9b653cc5c 100644
--- a/os/rt/include/chdynamic.h
+++ b/os/rt/include/chdynamic.h
@@ -71,16 +71,16 @@
#ifdef __cplusplus
extern "C" {
#endif
+ thread_t *chThdAddRef(thread_t *tp);
+ void chThdRelease(thread_t *tp);
#if CH_CFG_USE_HEAP == TRUE
thread_t *chThdCreateFromHeap(memory_heap_t *heapp, size_t size,
const char *name, tprio_t prio,
tfunc_t pf, void *arg);
- void chThdFreeToHeap(thread_t *tp);
#endif
#if CH_CFG_USE_MEMPOOLS == TRUE
thread_t *chThdCreateFromMemoryPool(memory_pool_t *mp, const char *name,
tprio_t prio, tfunc_t pf, void *arg);
- void chThdFreeToMemoryPool(thread_t *tp, memory_pool_t *mp);
#endif
#ifdef __cplusplus
}
diff --git a/os/rt/include/chevents.h b/os/rt/include/chevents.h
index fa8e4d7a5..8432eea8e 100644
--- a/os/rt/include/chevents.h
+++ b/os/rt/include/chevents.h
@@ -37,14 +37,6 @@
/* Module constants. */
/*===========================================================================*/
-/**
- * @brief Event bit reserved for thread termination request.
- * @note The most significant bit of the events mask is conventionally
- * used for thread termination but it can eventually be used for
- * other events.
- */
-#define CH_EVENT_TERMINATE ~(((eventmask_t)-1) >> 1U)
-
/*===========================================================================*/
/* Module pre-compile time settings. */
/*===========================================================================*/
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