Changeset ac8402dd in rtems


Ignore:
Timestamp:
Jun 27, 2016, 8:20:34 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
3a58dc8
Parents:
f4d1f30
git-author:
Sebastian Huber <sebastian.huber@…> (06/27/16 08:20:34)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/27/16 08:55:30)
Message:

score: Simplify _Thread_queue_Boost_priority()

Raise the priority under thread queue lock protection and omit the
superfluous thread queue priority change, since the thread is extracted
anyway. The unblock operation will pick up the new priority.

Update #2412.
Update #2556.
Update #2765.

Location:
cpukit/score/src
Files:
3 edited

Legend:

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

    rf4d1f30 rac8402dd  
    3939    _CORE_mutex_Set_owner( the_mutex, new_owner );
    4040
    41     unblock = _Thread_queue_Extract_locked(
    42       &the_mutex->Wait_queue.Queue,
    43       operations,
    44       new_owner,
    45       queue_context
    46     );
    47 
    4841#if defined(RTEMS_MULTIPROCESSING)
    4942    if ( _Objects_Is_local_id( new_owner->Object.id ) )
     
    5346      _Thread_queue_Boost_priority( &the_mutex->Wait_queue.Queue, new_owner );
    5447    }
     48
     49    unblock = _Thread_queue_Extract_locked(
     50      &the_mutex->Wait_queue.Queue,
     51      operations,
     52      new_owner,
     53      queue_context
     54    );
    5555
    5656    _Thread_queue_Unblock_critical(
  • cpukit/score/src/mutex.c

    rf4d1f30 rac8402dd  
    137137    mutex->Queue.Queue.owner = first;
    138138    ++first->resource_count;
     139    _Thread_queue_Boost_priority( &mutex->Queue.Queue, first );
    139140    unblock = _Thread_queue_Extract_locked(
    140141      &mutex->Queue.Queue,
     
    143144      queue_context
    144145    );
    145     _Thread_queue_Boost_priority( &mutex->Queue.Queue, first );
    146146    _Thread_queue_Unblock_critical(
    147147      unblock,
  • cpukit/score/src/threadqops.c

    rf4d1f30 rac8402dd  
    11/*
    2  * Copyright (c) 2015 embedded brains GmbH.  All rights reserved.
     2 * Copyright (c) 2015, 2016 embedded brains GmbH.  All rights reserved.
    33 *
    44 *  embedded brains GmbH
     
    319319  Thread_queue_Heads *heads = queue->heads;
    320320
    321   if (
    322     heads != NULL
    323       && (
    324         !_Chain_Has_only_one_node( &heads->Heads.Fifo )
    325           || _RBTree_Is_empty(
    326             &_Thread_queue_Priority_queue( heads, the_thread )->Queue
    327           )
    328       )
    329   ) {
    330     _Thread_Raise_priority( the_thread, PRIORITY_PSEUDO_ISR );
     321  if ( !_Chain_Has_only_one_node( &heads->Heads.Fifo ) ) {
     322    const Scheduler_Control *scheduler;
     323    Scheduler_Node          *own_node;
     324    Priority_Control         boost_priority;
     325
     326    the_thread->priority_restore_hint = true;
     327    _Atomic_Fence( ATOMIC_ORDER_ACQ_REL );
     328
     329    scheduler = _Scheduler_Get_own( the_thread );
     330    own_node = _Scheduler_Thread_get_own_node( the_thread );
     331    boost_priority = _Scheduler_Map_priority( scheduler, PRIORITY_PSEUDO_ISR );
     332    _Scheduler_Node_set_priority( own_node, boost_priority, false );
     333
     334    the_thread->current_priority = boost_priority;
    331335  }
    332336}
Note: See TracChangeset for help on using the changeset viewer.