Changeset b4bdbcf in rtems


Ignore:
Timestamp:
05/15/14 07:41:20 (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
c0bff5e
Parents:
6359b68
git-author:
Sebastian Huber <sebastian.huber@…> (05/15/14 07:41:20)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/15/14 10:18:49)
Message:

score: Make _Thread_queue_Requeue() static

This function is only used by _Thread_Change_priority(). Make it static
to avoid the function call overhead in the performance critical function
_Thread_Change_priority().

Location:
cpukit/score
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/Makefile.am

    r6359b68 rb4bdbcf  
    294294    src/threadqextractfifo.c src/threadqextractpriority.c \
    295295    src/threadqextractwithproxy.c src/threadqfirst.c src/threadqfirstfifo.c \
    296     src/threadqfirstpriority.c src/threadqflush.c src/threadqrequeue.c \
     296    src/threadqfirstpriority.c src/threadqflush.c \
    297297    src/threadqprocesstimeout.c src/threadqtimeout.c
    298298
  • cpukit/score/include/rtems/score/threadqimpl.h

    r6359b68 rb4bdbcf  
    112112
    113113/**
    114  *  @brief Invoked when a thread changes priority and is blocked.
    115  *
    116  *  This routine is invoked when a thread changes priority and is
    117  *  blocked on a thread queue.  If the queue is priority ordered,
    118  *  the_thread is removed from the_thread_queue and reinserted using
    119  *  its new priority.  This method has no impact on the state of the_thread
    120  *  or of any timeouts associated with this blocking.
    121  *
    122  *  @param[in] the_thread_queue pointer to a threadq header
    123  *  @param[in] the_thread pointer to a thread control block
    124  */
    125 void _Thread_queue_Requeue(
    126   Thread_queue_Control *the_thread_queue,
    127   Thread_Control       *the_thread
    128 );
    129 
    130 /**
    131114 *  @brief Extracts thread from thread queue.
    132115 *
  • cpukit/score/src/threadchangepriority.c

    r6359b68 rb4bdbcf  
    2323#include <rtems/score/schedulerimpl.h>
    2424#include <rtems/score/threadqimpl.h>
     25
     26/**
     27 *  @brief Invoked when a thread changes priority and is blocked.
     28 *
     29 *  This routine is invoked when a thread changes priority and is
     30 *  blocked on a thread queue.  If the queue is priority ordered,
     31 *  the_thread is removed from the_thread_queue and reinserted using
     32 *  its new priority.  This method has no impact on the state of the_thread
     33 *  or of any timeouts associated with this blocking.
     34 *
     35 *  @param[in] the_thread_queue pointer to a threadq header
     36 *  @param[in] the_thread pointer to a thread control block
     37 */
     38static void _Thread_queue_Requeue(
     39  Thread_queue_Control *the_thread_queue,
     40  Thread_Control       *the_thread
     41)
     42{
     43  /*
     44   * Just in case the thread really wasn't blocked on a thread queue
     45   * when we get here.
     46   */
     47  if ( !the_thread_queue )
     48    return;
     49
     50  /*
     51   * If queueing by FIFO, there is nothing to do. This only applies to
     52   * priority blocking discipline.
     53   */
     54  if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) {
     55    Thread_queue_Control *tq = the_thread_queue;
     56    ISR_Level             level;
     57    ISR_Level             level_ignored;
     58
     59    _ISR_Disable( level );
     60    if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
     61      _Thread_queue_Enter_critical_section( tq );
     62      _Thread_queue_Extract_priority_helper(
     63        the_thread,
     64        the_thread->Wait.return_code,
     65        true
     66      );
     67      (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored );
     68    }
     69    _ISR_Enable( level );
     70  }
     71}
    2572
    2673void _Thread_Change_priority(
Note: See TracChangeset for help on using the changeset viewer.