aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/include/threads.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-01-31 09:27:49 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-01-31 09:27:49 +0000
commit7f8dfe2fd3e770c2e0435e9c56f5db5fd11ed6f7 (patch)
tree7335786169736fb133adfdffbc4c60f2050dac0d /os/kernel/include/threads.h
parentc73b66a3cc8d7808b9c06e031c782345d358b3e9 (diff)
downloadChibiOS-7f8dfe2fd3e770c2e0435e9c56f5db5fd11ed6f7.tar.gz
ChibiOS-7f8dfe2fd3e770c2e0435e9c56f5db5fd11ed6f7.tar.bz2
ChibiOS-7f8dfe2fd3e770c2e0435e9c56f5db5fd11ed6f7.zip
Implemented thread reference counters and related APIs.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1556 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/include/threads.h')
-rw-r--r--os/kernel/include/threads.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/os/kernel/include/threads.h b/os/kernel/include/threads.h
index f94beac32..a9209e6ea 100644
--- a/os/kernel/include/threads.h
+++ b/os/kernel/include/threads.h
@@ -54,6 +54,9 @@ struct Thread {
/* End of the fields shared with the ThreadsQueue structure. */
tprio_t p_prio; /**< Thread priority. */
/* End of the fields shared with the ReadyList structure. */
+#if CH_USE_DYNAMIC
+ trefs_t p_refs; /**< References to this thread. */
+#endif
tstate_t p_state; /**< Current thread state. */
tmode_t p_flags; /**< Various thread flags. */
struct context p_ctx; /**< Processor context. */
@@ -61,7 +64,7 @@ struct Thread {
cnt_t p_locks; /**< Number of nested locks. */
#endif
#if CH_DBG_THREADS_PROFILING
- volatile systime_t p_time; /**< Thread consumed time in ticks.
+ volatile systime_t p_time; /**< Thread consumed time in ticks.
@note This field can overflow. */
#endif
union {
@@ -76,7 +79,7 @@ struct Thread {
#endif
} p_u; /**< State-specific fields. */
#if CH_USE_WAITEXIT
- Thread *p_waiting; /**< Thread waiting for termination.*/
+ ThreadsList p_waiting; /**< Termination waiting list. */
#endif
#if CH_USE_MESSAGES
ThreadsQueue p_msgqueue; /**< Messages queue. */
@@ -167,6 +170,10 @@ extern "C" {
void chThdSleepUntil(systime_t time);
void chThdYield(void);
void chThdExit(msg_t msg);
+#if CH_USE_DYNAMIC
+ Thread *chThdAddRef(Thread *tp);
+ Thread *chThdRelease(Thread *tp);
+#endif
#if CH_USE_WAITEXIT
msg_t chThdWait(Thread *tp);
#endif