summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/schedulersmpimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-12 09:06:53 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-12 09:06:53 +0200
commit82df6f347b9c6705684300248ff74784d58b2b86 (patch)
tree0fedc33e8e2d72840ea43e31d2d47a2dda6cc454 /cpukit/score/include/rtems/score/schedulersmpimpl.h
parentscore: Fix warnings (diff)
downloadrtems-82df6f347b9c6705684300248ff74784d58b2b86.tar.bz2
score: Move NULL pointer check to order function
This helps to avoid untestable code for the normal SMP schedulers.
Diffstat (limited to 'cpukit/score/include/rtems/score/schedulersmpimpl.h')
-rw-r--r--cpukit/score/include/rtems/score/schedulersmpimpl.h19
1 files changed, 4 insertions, 15 deletions
diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h
index ee81955f8c..b4126b5d6d 100644
--- a/cpukit/score/include/rtems/score/schedulersmpimpl.h
+++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h
@@ -471,7 +471,9 @@ static inline Thread_Control *_Scheduler_SMP_Get_lowest_scheduled(
* @param[in] move_from_scheduled_to_ready Function to move a node from the set
* of scheduled nodes to the set of ready nodes.
* @param[in] get_lowest_scheduled Function to select the thread from the
- * scheduled nodes to replace. It may not be possible to find one.
+ * scheduled nodes to replace. It may not be possible to find one, in this
+ * case a pointer must be returned so that the order functions returns false
+ * if this pointer is passed as the second argument to the order function.
* @param[in] allocate_processor Function to allocate a processor to a thread
* based on the rules of the scheduler.
*/
@@ -490,20 +492,7 @@ static inline void _Scheduler_SMP_Enqueue_ordered(
Thread_Control *lowest_scheduled =
( *get_lowest_scheduled )( context, thread, order );
- /*
- * get_lowest_scheduled can return a NULL if no scheduled threads
- * should be removed from their processor based on the selection
- * criteria. For example, this can occur when the affinity of the
- * thread being enqueued schedules it against higher priority threads.
- * A low priority thread with affinity can only consider the threads
- * which are on the cores if has affinity for.
- *
- * The get_lowest_scheduled helper should assert on not returning NULL
- * if that is not possible for that scheduler.
- */
-
- if ( lowest_scheduled &&
- ( *order )( &thread->Object.Node, &lowest_scheduled->Object.Node ) ) {
+ if ( ( *order )( &thread->Object.Node, &lowest_scheduled->Object.Node ) ) {
Scheduler_SMP_Node *lowest_scheduled_node =
_Scheduler_SMP_Node_get( lowest_scheduled );