aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/include/chthreads.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-08-22 17:18:52 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-08-22 17:18:52 +0000
commit2d55ac3059fcca69cc9736db310b4521064c2b23 (patch)
tree6d0721f3bbfbd1d078c6342b4009844fdff129cd /os/kernel/include/chthreads.h
parent334ee6970801e8b72f8a36daa3d42acda56ec15e (diff)
downloadChibiOS-2d55ac3059fcca69cc9736db310b4521064c2b23.tar.gz
ChibiOS-2d55ac3059fcca69cc9736db310b4521064c2b23.tar.bz2
ChibiOS-2d55ac3059fcca69cc9736db310b4521064c2b23.zip
Documentation improvements and code comments reformatting.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3248 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/include/chthreads.h')
-rw-r--r--os/kernel/include/chthreads.h76
1 files changed, 36 insertions, 40 deletions
diff --git a/os/kernel/include/chthreads.h b/os/kernel/include/chthreads.h
index a0a668df4..eb3d8bb14 100644
--- a/os/kernel/include/chthreads.h
+++ b/os/kernel/include/chthreads.h
@@ -30,6 +30,42 @@
#define _CHTHREADS_H_
/**
+ * @name Thread states
+ * @{
+ */
+#define THD_STATE_READY 0 /**< @brief Waiting on the ready list. */
+#define THD_STATE_CURRENT 1 /**< @brief Currently running. */
+#define THD_STATE_SUSPENDED 2 /**< @brief Created in suspended state. */
+#define THD_STATE_WTSEM 3 /**< @brief Waiting on a semaphore. */
+#define THD_STATE_WTMTX 4 /**< @brief Waiting on a mutex. */
+#define THD_STATE_WTCOND 5 /**< @brief Waiting on a condition
+ variable. */
+#define THD_STATE_SLEEPING 6 /**< @brief Waiting in @p chThdSleep()
+ or @p chThdSleepUntil(). */
+#define THD_STATE_WTEXIT 7 /**< @brief Waiting in @p chThdWait(). */
+#define THD_STATE_WTOREVT 8 /**< @brief Waiting for an event. */
+#define THD_STATE_WTANDEVT 9 /**< @brief Waiting for several events. */
+#define THD_STATE_SNDMSGQ 10 /**< @brief Sending a message, in queue.*/
+#define THD_STATE_SNDMSG 11 /**< @brief Sent a message, waiting
+ answer. */
+#define THD_STATE_WTMSG 12 /**< @brief Waiting for a message. */
+#define THD_STATE_WTQUEUE 13 /**< @brief Waiting on an I/O queue. */
+#define THD_STATE_FINAL 14 /**< @brief Thread terminated. */
+/** @} */
+
+/**
+ * @name Thread flags and attributes
+ * @{
+ */
+#define THD_MEM_MODE_MASK 3 /**< @brief Thread memory mode mask. */
+#define THD_MEM_MODE_STATIC 0 /**< @brief Static thread. */
+#define THD_MEM_MODE_HEAP 1 /**< @brief Thread allocated from Heap. */
+#define THD_MEM_MODE_MEMPOOL 2 /**< @brief Thread allocated from Memory
+ Pool. */
+#define THD_TERMINATE 4 /**< @brief Termination requested flag. */
+/** @} */
+
+/**
* @extends ThreadsQueue
*
* @brief Structure representing a thread.
@@ -163,46 +199,6 @@ struct Thread {
#endif
};
-/** @brief Thread state: Ready to run, waiting on the ready list.*/
-#define THD_STATE_READY 0
-/** @brief Thread state: Currently running.*/
-#define THD_STATE_CURRENT 1
-/** @brief Thread state: Thread created in suspended state.*/
-#define THD_STATE_SUSPENDED 2
-/** @brief Thread state: Waiting on a semaphore.*/
-#define THD_STATE_WTSEM 3
-/** @brief Thread state: Waiting on a mutex.*/
-#define THD_STATE_WTMTX 4
-/** @brief Thread state: Waiting in @p chCondWait().*/
-#define THD_STATE_WTCOND 5
-/** @brief Thread state: Waiting in @p chThdSleep() or @p chThdSleepUntil().*/
-#define THD_STATE_SLEEPING 6
-/** @brief Thread state: Waiting in @p chThdWait().*/
-#define THD_STATE_WTEXIT 7
-/** @brief Thread state: Waiting in @p chEvtWaitXXX().*/
-#define THD_STATE_WTOREVT 8
-/** @brief Thread state: Waiting in @p chEvtWaitAllTimeout().*/
-#define THD_STATE_WTANDEVT 9
-/** @brief Thread state: Waiting in @p chMsgSend() (queued).*/
-#define THD_STATE_SNDMSGQ 10
-/** @brief Thread state: Waiting in @p chMsgSend() (not queued).*/
-#define THD_STATE_SNDMSG 11
-/** @brief Thread state: Waiting in @p chMsgWait().*/
-#define THD_STATE_WTMSG 12
-/** @brief Thread state: Waiting on an I/O queue.*/
-#define THD_STATE_WTQUEUE 13
-/** @brief Thread state: After termination.*/
-#define THD_STATE_FINAL 14
-
-/*
- * Various flags into the thread p_flags field.
- */
-#define THD_MEM_MODE_MASK 3 /**< @brief Thread memory mode mask. */
-#define THD_MEM_MODE_STATIC 0 /**< @brief Thread memory mode: static. */
-#define THD_MEM_MODE_HEAP 1 /**< @brief Thread memory mode: heap. */
-#define THD_MEM_MODE_MEMPOOL 2 /**< @brief Thread memory mode: pool. */
-#define THD_TERMINATE 4 /**< @brief Termination requested. */
-
/**
* @brief Thread function.
*/