From 55e8eabccb4f0c5fe448055a16b4dfa916977477 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 18 Mar 2010 21:41:33 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1753 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/src/chschd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index c561cbd41..d5c8a0a5a 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -112,7 +112,6 @@ void chSchGoSleepS(tstate_t newstate) { static void wakeup(void *p) { Thread *tp = (Thread *)p; - tp->p_u.rdymsg = RDY_TIMEOUT; #if CH_USE_SEMAPHORES || (CH_USE_CONDVARS && CH_USE_CONDVARS_TIMEOUT) switch (tp->p_state) { #if CH_USE_SEMAPHORES @@ -127,6 +126,8 @@ static void wakeup(void *p) { dequeue(tp); } #endif + /* Done this way in order to allow a tail call.*/ + tp->p_u.rdymsg = RDY_TIMEOUT; chSchReadyI(tp); } -- cgit v1.2.3