aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'os/kernel')
-rw-r--r--os/kernel/src/chschd.c12
1 files changed, 6 insertions, 6 deletions
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);
}
/**