diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-07-08 19:29:00 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-07-08 19:29:00 +0000 |
commit | d79eea31a268ce14b60b30d929b2d2c905048d98 (patch) | |
tree | baf758ae63a822fd0361d4d4c94736f51c28d57c /os/kernel/include/chthreads.h | |
parent | 83c5424c5f6d3c970a32e6303033ff651bf0287b (diff) | |
download | ChibiOS-d79eea31a268ce14b60b30d929b2d2c905048d98.tar.gz ChibiOS-d79eea31a268ce14b60b30d929b2d2c905048d98.tar.bz2 ChibiOS-d79eea31a268ce14b60b30d929b2d2c905048d98.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3135 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/include/chthreads.h')
-rw-r--r-- | os/kernel/include/chthreads.h | 66 |
1 files changed, 37 insertions, 29 deletions
diff --git a/os/kernel/include/chthreads.h b/os/kernel/include/chthreads.h index 215bb9920..e0f1b3e95 100644 --- a/os/kernel/include/chthreads.h +++ b/os/kernel/include/chthreads.h @@ -49,6 +49,12 @@ struct Thread { Thread *p_older; /**< @brief Older registry element. */
#endif
/* End of the fields shared with the ReadyList structure. */
+#if CH_USE_REGISTRY
+ /**
+ * @brief Thread name or @p NULL.
+ */
+ const char *p_name;
+#endif
/**
* @brief Current thread state.
*/
@@ -197,36 +203,10 @@ struct Thread { #define THD_MEM_MODE_MEMPOOL 2 /**< @brief Thread memory mode: pool. */
#define THD_TERMINATE 4 /**< @brief Termination requested. */
-/** @brief Thread function.*/
-typedef msg_t (*tfunc_t)(void *);
-
-/*
- * Threads APIs.
+/**
+ * @brief Thread function.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
- Thread *_thread_init(Thread *tp, tprio_t prio);
-#if CH_DBG_FILL_THREADS
- void _thread_memfill(uint8_t *startp, uint8_t *endp, uint8_t v);
-#endif
- Thread *chThdCreateI(void *wsp, size_t size,
- tprio_t prio, tfunc_t pf, void *arg);
- Thread *chThdCreateStatic(void *wsp, size_t size,
- tprio_t prio, tfunc_t pf, void *arg);
- tprio_t chThdSetPriority(tprio_t newprio);
- Thread *chThdResume(Thread *tp);
- void chThdTerminate(Thread *tp);
- void chThdSleep(systime_t time);
- void chThdSleepUntil(systime_t time);
- void chThdYield(void);
- void chThdExit(msg_t msg);
-#if CH_USE_WAITEXIT
- msg_t chThdWait(Thread *tp);
-#endif
-#ifdef __cplusplus
-}
-#endif
+typedef msg_t (*tfunc_t)(void *);
/**
* @brief Returns a pointer to the current @p Thread.
@@ -342,6 +322,34 @@ extern "C" { */
#define chThdSleepMicroseconds(usec) chThdSleep(US2ST(usec))
+/*
+ * Threads APIs.
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+ Thread *_thread_init(Thread *tp, tprio_t prio);
+#if CH_DBG_FILL_THREADS
+ void _thread_memfill(uint8_t *startp, uint8_t *endp, uint8_t v);
+#endif
+ Thread *chThdCreateI(void *wsp, size_t size,
+ tprio_t prio, tfunc_t pf, void *arg);
+ Thread *chThdCreateStatic(void *wsp, size_t size,
+ tprio_t prio, tfunc_t pf, void *arg);
+ tprio_t chThdSetPriority(tprio_t newprio);
+ Thread *chThdResume(Thread *tp);
+ void chThdTerminate(Thread *tp);
+ void chThdSleep(systime_t time);
+ void chThdSleepUntil(systime_t time);
+ void chThdYield(void);
+ void chThdExit(msg_t msg);
+#if CH_USE_WAITEXIT
+ msg_t chThdWait(Thread *tp);
+#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _CHTHREADS_H_ */
/** @} */
|