[rtems commit] score: Fix for RTEMS_DEBUG

Sebastian Huber sebh at rtems.org
Tue Mar 22 06:28:33 UTC 2016


Module:    rtems
Branch:    master
Commit:    baa1362643f20781db1d50a5a4d23e7069d0972a
Changeset: http://git.rtems.org/rtems/commit/?id=baa1362643f20781db1d50a5a4d23e7069d0972a

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Mar 22 07:22:08 2016 +0100

score: Fix for RTEMS_DEBUG

Update #2627.

---

 cpukit/score/include/rtems/score/schedulerimpl.h | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index a41b7ea..5cf3503 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -1352,9 +1352,14 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir(
 
   if ( heir != new_heir && ( heir->is_preemptible || force_dispatch ) ) {
 #if defined(RTEMS_SMP)
-    /* We need this state only for _Thread_Get_CPU_time_used() */
-    _Scheduler_Thread_change_state( heir, THREAD_SCHEDULER_BLOCKED );
-    _Scheduler_Thread_change_state( new_heir, THREAD_SCHEDULER_SCHEDULED );
+    /*
+     * We need this state only for _Thread_Get_CPU_time_used().  Cannot use
+     * _Scheduler_Thread_change_state() since THREAD_SCHEDULER_BLOCKED to
+     * THREAD_SCHEDULER_BLOCKED state changes are illegal for the real SMP
+     * schedulers.
+     */
+    heir->Scheduler.state = THREAD_SCHEDULER_BLOCKED;
+    new_heir->Scheduler.state = THREAD_SCHEDULER_SCHEDULED;
 #endif
     _Thread_Update_CPU_time_used( heir, _Thread_Get_CPU( heir ) );
     _Thread_Heir = new_heir;




More information about the vc mailing list