aboutsummaryrefslogtreecommitdiffstats
path: root/src/chsleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/chsleep.c')
-rw-r--r--src/chsleep.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/src/chsleep.c b/src/chsleep.c
index b6c31e1a4..9dad520c7 100644
--- a/src/chsleep.c
+++ b/src/chsleep.c
@@ -25,47 +25,18 @@
#include <ch.h>
#ifdef CH_USE_SLEEP
-static void wakeup(void *p) {
-
- chDbgAssert(((Thread *)p)->p_state == PRSLEEP, "chsleep.c, wakeup()");
- chSchReadyI(p, RDY_OK);
-}
-
/**
* Suspends the invoking thread for the specified time.
* @param time the system ticks number
*/
void chThdSleep(t_time time) {
- VirtualTimer vt;
chSysLock();
- chVTSetI(&vt, time, wakeup, currp);
- chSchGoSleepS(PRSLEEP);
+ chSchGoSleepTimeoutS(PRSLEEP, time);
chSysUnlock();
}
-
-#ifdef CH_USE_SYSTEMTIME
-/**
- * Suspends the invoking thread until the system time arrives to the specified
- * value.
- * @param time the system time
- * @note The function is available only if the \p CH_USE_SYSTEMTIME
- * option is enabled in \p chconf.h.
- */
-void chThdSleepUntil(t_time time) {
- VirtualTimer vt;
-
- chSysLock();
-
- chVTSetI(&vt, (t_time)(time - rlist.r_stime), wakeup, currp);
- chSchGoSleepS(PRSLEEP);
-
- chSysUnlock();
-}
-#endif /* CH_USE_SYSTEMTIME */
-
#endif /* CH_USE_SLEEP */
/** @} */