From 88c256ae5265f5d6a7ffa25dc17f693e036256bf Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 11 Mar 2008 14:32:04 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@222 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/chschd.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/chschd.c') 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; -- cgit v1.2.3