diff options
Diffstat (limited to 'src/chthreads.c')
-rw-r--r-- | src/chthreads.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/chthreads.c b/src/chthreads.c index 58df0a5c1..11d2442ad 100644 --- a/src/chthreads.c +++ b/src/chthreads.c @@ -288,6 +288,17 @@ void chThdTerminate(Thread *tp) { } /** + * Suspends the invoking thread for the specified time. + * @param time the system ticks number + */ +void chThdSleep(systime_t time) { + + chSysLock(); + 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 |