diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-10-26 10:45:42 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-10-26 10:45:42 +0000 |
commit | 3c4cadc596f201c3377de40a62685b3b9d7b9de1 (patch) | |
tree | 1b02fbfeb8823d24ad53a6860a070fd5e0a70bce /src/chthreads.c | |
parent | 79280551050445d86045df9e160af2f9c85b40a3 (diff) | |
download | ChibiOS-3c4cadc596f201c3377de40a62685b3b9d7b9de1.tar.gz ChibiOS-3c4cadc596f201c3377de40a62685b3b9d7b9de1.tar.bz2 ChibiOS-3c4cadc596f201c3377de40a62685b3b9d7b9de1.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@484 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/chthreads.c')
-rw-r--r-- | src/chthreads.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/chthreads.c b/src/chthreads.c index 11d2442ad..3f55c4de5 100644 --- a/src/chthreads.c +++ b/src/chthreads.c @@ -289,7 +289,7 @@ void chThdTerminate(Thread *tp) { /** * Suspends the invoking thread for the specified time. - * @param time the system ticks number + * @param time the delay in system ticks */ void chThdSleep(systime_t time) { @@ -299,6 +299,19 @@ void chThdSleep(systime_t time) { } /** + * Suspends the invoking thread until the system time arrives to the specified + * value. + * @param time the absolute system time + */ +void chThdSleepUntil(systime_t time) { + + chSysLock(); + if ((time -= chSysGetTime()) > 0) + chSchGoSleepTimeoutS(PRSLEEP, time); + chSysUnlock(); +} + +/** * Terminates the current thread by specifying an exit status code. * * @param msg the thread exit code. The code can be retrieved by using |