Changeset 8c25e04 in rtems


Ignore:
Timestamp:
Sep 2, 2015, 1:02:27 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
e9fbaa3b
Parents:
3b3d1489
Message:

score: Optimize thread queue first operation

In case the thread queue heads exist, then the queue is not empty. See
_Thread_queue_First_locked().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/threadqops.c

    r3b3d1489 r8c25e04  
    143143{
    144144  Chain_Control *fifo = &heads->Heads.Fifo;
    145 
    146   return _Chain_Is_empty( fifo ) ?
    147     NULL : THREAD_CHAIN_NODE_TO_THREAD( _Chain_First( fifo ) );
     145  Chain_Node    *first;
     146
     147  _Assert( !_Chain_Is_empty( fifo ) );
     148  first = _Chain_First( fifo );
     149
     150  return THREAD_CHAIN_NODE_TO_THREAD( first );
    148151}
    149152
     
    230233)
    231234{
    232   RBTree_Node *first;
    233 
    234   first = _RBTree_Minimum( &heads->Heads.Priority );
    235 
    236   return first != NULL ? THREAD_RBTREE_NODE_TO_THREAD( first ) : NULL;
     235  RBTree_Control *priority_queue = &heads->Heads.Priority;
     236  RBTree_Node    *first;
     237
     238  _Assert( !_RBTree_Is_empty( priority_queue ) );
     239  first = _RBTree_Minimum( priority_queue );
     240
     241  return THREAD_RBTREE_NODE_TO_THREAD( first );
    237242}
    238243
Note: See TracChangeset for help on using the changeset viewer.