aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/chschd.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/chschd.c b/src/chschd.c
index 7a14df518..b7f52c96d 100644
--- a/src/chschd.c
+++ b/src/chschd.c
@@ -93,8 +93,10 @@ void chSchGoSleepS(tstate_t newstate) {
#ifdef CH_USE_VIRTUAL_TIMERS
static void wakeup(void *p) {
+#ifdef CH_USE_SEMAPHORES
if (((Thread *)p)->p_state == PRWTSEM)
chSemFastSignalI(((Thread *)p)->p_wtsemp);
+#endif
chSchReadyI(p, RDY_TIMEOUT);
}
@@ -170,10 +172,8 @@ void chSchDoRescheduleI(void) {
*/
void chSchRescheduleS(void) {
- if (isempty(&rlist.r_queue) || firstprio(&rlist.r_queue) <= currp->p_prio)
- return;
-
- chSchDoRescheduleI();
+ if (firstprio(&rlist.r_queue) > currp->p_prio)
+ chSchDoRescheduleI();
}
/**
@@ -183,9 +183,6 @@ void chSchRescheduleS(void) {
*/
bool_t chSchRescRequiredI(void) {
- if (isempty(&rlist.r_queue))
- return FALSE;
-
if (rlist.r_preempt) {
if (firstprio(&rlist.r_queue) <= currp->p_prio)
return FALSE;