From c4299aa2dac83bfe3cee1bf65bfa4ee9f84233bd Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 28 Aug 2009 11:54:36 +0000 Subject: [PATCH] Fixed bug 2846162. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1110 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/src/chschd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index 3ba8b29e9..846833286 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -138,18 +138,19 @@ static void wakeup(void *p) { * @retval RDY_TIMEOUT if a timeout occurs. */ msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) { + Thread *tp = currp; if (TIME_INFINITE != time) { VirtualTimer vt; - chVTSetI(&vt, time, wakeup, currp); + chVTSetI(&vt, time, wakeup, tp); chSchGoSleepS(newstate); if (chVTIsArmedI(&vt)) chVTResetI(&vt); } else chSchGoSleepS(newstate); - return currp->p_rdymsg; + return tp->p_rdymsg; } /**