aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/src/chschd.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/kernel/src/chschd.c')
-rw-r--r--os/kernel/src/chschd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c
index c7db9ad60..f12103324 100644
--- a/os/kernel/src/chschd.c
+++ b/os/kernel/src/chschd.c
@@ -143,9 +143,12 @@ 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);
+ /* 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);
+ }
}
/**