aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/threads.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-10-25 10:35:10 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-10-25 10:35:10 +0000
commit3547c3916175d387a43c6d3a36330550b1d278d5 (patch)
tree4df53f634f4c2923df3c8fac48a3826aa0e24dc2 /src/include/threads.h
parent902470d1c542735b989a727355744a974af43de4 (diff)
downloadChibiOS-3547c3916175d387a43c6d3a36330550b1d278d5.tar.gz
ChibiOS-3547c3916175d387a43c6d3a36330550b1d278d5.tar.bz2
ChibiOS-3547c3916175d387a43c6d3a36330550b1d278d5.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@482 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/include/threads.h')
-rw-r--r--src/include/threads.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/include/threads.h b/src/include/threads.h
index 051ca482d..e9894650d 100644
--- a/src/include/threads.h
+++ b/src/include/threads.h
@@ -189,10 +189,11 @@ extern "C" {
Thread *chThdCreate(tprio_t prio, tmode_t mode, void *workspace,
size_t wsize, tfunc_t pf, void *arg);
void chThdSetPriority(tprio_t newprio);
- void chThdExit(msg_t msg);
Thread *chThdResume(Thread *tp);
void chThdSuspend(Thread **tpp);
void chThdTerminate(Thread *tp);
+ void chThdSleep(systime_t time);
+ void chThdExit(msg_t msg);
#ifdef CH_USE_WAITEXIT
msg_t chThdWait(Thread *tp);
#endif
@@ -266,6 +267,17 @@ extern "C" {
#define chThdCreateFast(prio, workspace, wsize, pf) \
chThdCreateStatic(workspace, wsize, prio, pf, NULL)
+/**
+ * Suspends the invoking thread until the system time arrives to the specified
+ * value.
+ */
+#define chThdSleepUntil(t) { \
+ chSysLock(); \
+ chSchGoSleepTimeoutS(PRSLEEP, \
+ (systime_t)((t) - chSysGetTime())); \
+ chSysUnlock(); \
+}
+
#endif /* _THREADS_H_ */
/** @} */