From 719cf5fa8d01d6660fa85708c03fcf3cdac8bf37 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 7 Mar 2009 10:54:51 +0000 Subject: Implemented handling for constant TIME_ZERO for timeout specifications. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@811 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/chschd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/chschd.c') diff --git a/src/chschd.c b/src/chschd.c index aad060ac9..3c17c3831 100644 --- a/src/chschd.c +++ b/src/chschd.c @@ -122,8 +122,10 @@ static void wakeup(void *p) { * to sleep is awakened after the specified time has elapsed. * * @param newstate the new thread state - * @param time the number of ticks before the operation timeouts. The value - * zero (@p TIME_INFINITE) is allowed. + * @param time the number of ticks before the operation timeouts. The + * following special values are allowed: + * - @p TIME_ZERO immediate timeout. + * - @p TIME_INFINITE no timeout. * @return The wakeup message. * @retval RDY_TIMEOUT if a timeout occurs. * @note The function must be called in the system mutex zone. @@ -131,6 +133,8 @@ static void wakeup(void *p) { */ msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) { + if (TIME_ZERO == time) + return RDY_OK; if (TIME_INFINITE != time) { VirtualTimer vt; -- cgit v1.2.3