[haiku-commits] r34614 - haiku/trunk/src/system/kernel

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 10 Dec 2009 12:29:38 +0100 (CET)

Author: bonefish
Date: 2009-12-10 12:29:38 +0100 (Thu, 10 Dec 2009)
New Revision: 34614
Changeset: http://dev.haiku-os.org/changeset/34614/haiku
Ticket: http://dev.haiku-os.org/ticket/3535

Modified:
   haiku/trunk/src/system/kernel/timer.cpp
Log:
When any of the executed timer hooks return B_INVOKE_SCHEDULER, let
timer_interrupt() return B_INVOKE_SCHEDULER. The scheduler itself uses a
timer hook and relies on scheduler_reschedule() to be called. Will make this
even more reliable in the next commit.
This might fix #3535.


Modified: haiku/trunk/src/system/kernel/timer.cpp
===================================================================
--- haiku/trunk/src/system/kernel/timer.cpp     2009-12-10 11:14:46 UTC (rev 
34613)
+++ haiku/trunk/src/system/kernel/timer.cpp     2009-12-10 11:29:38 UTC (rev 
34614)
@@ -77,6 +77,7 @@
        spinlock *spinlock;
        per_cpu_timer_data& cpuData = sPerCPU[smp_get_current_cpu()];
        int32 rc = B_HANDLED_INTERRUPT;
+       bool invokeScheduler = false;
 
        TRACE(("timer_interrupt: time %lld, cpu %ld\n", system_time(),
                smp_get_current_cpu()));
@@ -121,6 +122,9 @@
 
                        if ((mode & B_TIMER_ACQUIRE_THREAD_LOCK) != 0)
                                RELEASE_THREAD_LOCK();
+
+                       if (rc == B_INVOKE_SCHEDULER)
+                               invokeScheduler = true;
                }
 
                cpuData.current_event_in_progress = 0;
@@ -153,7 +157,7 @@
 
        release_spinlock(spinlock);
 
-       return rc;
+       return invokeScheduler ? B_INVOKE_SCHEDULER : rc;
 }
 
 


Other related posts:

  • » [haiku-commits] r34614 - haiku/trunk/src/system/kernel - ingo_weinhold