From 5b3fec0235acc100600054917d9d393db189b5cb Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 24 Sep 2010 17:58:21 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2187 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/src/chschd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'os/kernel') diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index f12103324..ff10dbe2d 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -131,6 +131,10 @@ static void wakeup(void *p) { #if CH_USE_SEMAPHORES || (CH_USE_CONDVARS && CH_USE_CONDVARS_TIMEOUT) switch (tp->p_state) { + case THD_STATE_READY: + /* Handling the special case where the thread has been made ready by + another thread with higher priority.*/ + return; #if CH_USE_SEMAPHORES case THD_STATE_WTSEM: chSemFastSignalI((Semaphore *)tp->p_u.wtobjp); @@ -143,12 +147,8 @@ static void wakeup(void *p) { dequeue(tp); } #endif - /* Handling the special case where the thread has been made ready by another - thread with higher priority.*/ - if (tp->p_state != THD_STATE_READY) { - tp->p_u.rdymsg = RDY_TIMEOUT; - chSchReadyI(tp); - } + tp->p_u.rdymsg = RDY_TIMEOUT; + chSchReadyI(tp); } /** -- cgit v1.2.3