[rtems commit] score: Avoid copy and paste

Sebastian Huber sebh at rtems.org
Mon Apr 28 08:02:53 UTC 2014


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Apr 28 09:56:33 2014 +0200

score: Avoid copy and paste

---

 .../score/include/rtems/score/schedulersmpimpl.h   |   34 +++++++++-----------
 1 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h
index 20c5d17..c3e11e6 100644
--- a/cpukit/score/include/rtems/score/schedulersmpimpl.h
+++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h
@@ -192,16 +192,13 @@ static inline void _Scheduler_SMP_Schedule_highest_ready(
   ( *move_from_ready_to_scheduled )( self, highest_ready );
 }
 
-static inline void _Scheduler_SMP_Block(
+static inline void _Scheduler_SMP_Schedule(
   Scheduler_SMP_Context *self,
   Thread_Control *thread,
-  Scheduler_SMP_Extract extract,
   Scheduler_SMP_Get_highest_ready get_highest_ready,
   Scheduler_SMP_Move move_from_ready_to_scheduled
 )
 {
-  ( *extract )( self, thread );
-
   if ( thread->is_in_the_air ) {
     thread->is_in_the_air = false;
 
@@ -214,32 +211,31 @@ static inline void _Scheduler_SMP_Block(
   }
 }
 
-static inline void _Scheduler_SMP_Extract(
+static inline void _Scheduler_SMP_Block(
   Scheduler_SMP_Context *self,
   Thread_Control *thread,
-  Scheduler_SMP_Extract extract
+  Scheduler_SMP_Extract extract,
+  Scheduler_SMP_Get_highest_ready get_highest_ready,
+  Scheduler_SMP_Move move_from_ready_to_scheduled
 )
 {
   ( *extract )( self, thread );
+
+  _Scheduler_SMP_Schedule(
+    self,
+    thread,
+    get_highest_ready,
+    move_from_ready_to_scheduled
+  );
 }
 
-static inline void _Scheduler_SMP_Schedule(
+static inline void _Scheduler_SMP_Extract(
   Scheduler_SMP_Context *self,
   Thread_Control *thread,
-  Scheduler_SMP_Get_highest_ready get_highest_ready,
-  Scheduler_SMP_Move move_from_ready_to_scheduled
+  Scheduler_SMP_Extract extract
 )
 {
-  if ( thread->is_in_the_air ) {
-    thread->is_in_the_air = false;
-
-    _Scheduler_SMP_Schedule_highest_ready(
-      self,
-      thread,
-      get_highest_ready,
-      move_from_ready_to_scheduled
-    );
-  }
+  ( *extract )( self, thread );
 }
 
 static inline void _Scheduler_SMP_Insert_scheduled_lifo(




More information about the vc mailing list