Changeset 5b6c290 in rtems


Ignore:
Timestamp:
Dec 1, 2016, 7:42:48 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
d10716f
Parents:
6cc83b32
git-author:
Sebastian Huber <sebastian.huber@…> (12/01/16 19:42:48)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/02/16 11:41:03)
Message:

score: Initialize thread queue context early

Initialize thread queue context early preferably outside the critical
section.

Remove implicit _Thread_queue_Context_initialize() from
_Thread_Wait_acquire().

Files:
16 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/monitor/mon-task.c

    r6cc83b32 r5b6c290  
    2323    Thread_queue_Context queue_context;
    2424
     25    _Thread_queue_Context_initialize( &queue_context );
    2526    _Thread_Wait_acquire( rtems_thread, &queue_context );
    2627
  • cpukit/posix/src/mutexsetprioceiling.c

    r6cc83b32 r5b6c290  
    6868      Per_CPU_Control      *cpu_self;
    6969
     70      _Thread_queue_Context_initialize( &queue_context );
     71      _Thread_queue_Context_clear_priority_updates( &queue_context );
    7072      _CORE_ceiling_mutex_Set_priority(
    7173        &the_mutex->Mutex,
  • cpukit/posix/src/pthread.c

    r6cc83b32 r5b6c290  
    9292  the_thread = api->thread;
    9393
     94  _Thread_queue_Context_initialize( &queue_context );
     95  _Thread_queue_Context_clear_priority_updates( &queue_context );
    9496  _Thread_Wait_acquire( the_thread, &queue_context );
    95   _Thread_queue_Context_clear_priority_updates( &queue_context );
    9697
    9798  if ( _Priority_Node_is_active( &api->Sporadic.Low_priority ) ) {
     
    123124  api = the_thread->API_Extensions[ THREAD_API_POSIX ];
    124125
     126  _Thread_queue_Context_initialize( &queue_context );
     127  _Thread_queue_Context_clear_priority_updates( &queue_context );
    125128  _Thread_Wait_acquire( the_thread, &queue_context );
    126   _Thread_queue_Context_clear_priority_updates( &queue_context );
    127129
    128130  /*
  • cpukit/posix/src/pthreadgetschedparam.c

    r6cc83b32 r5b6c290  
    4646  }
    4747
     48  _Thread_queue_Context_initialize( &queue_context );
    4849  the_thread = _Thread_Get( thread, &queue_context.Lock_context.Lock_context );
    4950
     
    5455  api = the_thread->API_Extensions[ THREAD_API_POSIX ];
    5556
    56   _Thread_queue_Context_initialize( &queue_context );
    5757  _Thread_Wait_acquire_critical( the_thread, &queue_context );
    5858
  • cpukit/posix/src/pthreadsetschedparam.c

    r6cc83b32 r5b6c290  
    139139  }
    140140
     141  _Thread_queue_Context_initialize( &queue_context );
     142  _Thread_queue_Context_clear_priority_updates( &queue_context );
    141143  the_thread = _Thread_Get( thread, &queue_context.Lock_context.Lock_context );
    142144
     
    145147  }
    146148
    147   _Thread_queue_Context_clear_priority_updates( &queue_context );
    148149  _Thread_Wait_acquire_critical( the_thread, &queue_context );
    149150  error = _POSIX_Set_sched_param(
  • cpukit/posix/src/pthreadsetschedprio.c

    r6cc83b32 r5b6c290  
    2828  bool                     valid;
    2929
     30  _Thread_queue_Context_initialize( &queue_context );
     31  _Thread_queue_Context_clear_priority_updates( &queue_context );
    3032  the_thread = _Thread_Get( thread, &queue_context.Lock_context.Lock_context );
    3133
     
    3436  }
    3537
    36   _Thread_queue_Context_clear_priority_updates( &queue_context );
    3738  _Thread_Wait_acquire_critical( the_thread, &queue_context );
    3839
  • cpukit/rtems/src/schedulerremoveprocessor.c

    r6cc83b32 r5b6c290  
    4242  iter_context = arg;
    4343
     44  _Thread_queue_Context_initialize( &queue_context );
    4445  _Thread_Wait_acquire( the_thread, &queue_context );
    4546  _Thread_State_acquire_critical( the_thread, &state_context );
  • cpukit/rtems/src/semcreate.c

    r6cc83b32 r5b6c290  
    169169
    170170          _Thread_queue_Context_initialize( &queue_context );
     171          _Thread_queue_Context_clear_priority_updates( &queue_context );
    171172          _ISR_lock_ISR_disable( &queue_context.Lock_context.Lock_context );
    172173          _CORE_mutex_Acquire_critical(
  • cpukit/rtems/src/tasksetpriority.c

    r6cc83b32 r5b6c290  
    4545  }
    4646
    47   _Thread_queue_Context_clear_priority_updates( queue_context );
    4847  _Thread_Priority_change(
    4948    the_thread,
     
    7978
    8079  _Thread_queue_Context_initialize( &queue_context );
     80  _Thread_queue_Context_clear_priority_updates( &queue_context );
    8181  the_thread = _Thread_Get( id, &queue_context.Lock_context.Lock_context );
    8282
  • cpukit/score/include/rtems/score/coremuteximpl.h

    r6cc83b32 r5b6c290  
    254254  if ( owner != NULL ) {
    255255    _Thread_Wait_acquire( owner, queue_context );
    256     _Thread_queue_Context_clear_priority_updates( queue_context );
    257256    _Thread_Priority_change(
    258257      owner,
     
    285284  Per_CPU_Control  *cpu_self;
    286285
    287   _Thread_queue_Context_clear_priority_updates( queue_context );
    288286  _Thread_Wait_acquire_default_critical( owner, &lock_context );
    289287
     
    342340#endif
    343341
     342    _Thread_queue_Context_clear_priority_updates( queue_context );
    344343    return _CORE_ceiling_mutex_Set_owner(
    345344      the_mutex,
  • cpukit/score/include/rtems/score/mrspimpl.h

    r6cc83b32 r5b6c290  
    133133)
    134134{
    135   ISR_lock_Context  lock_context;
     135  ISR_lock_Context lock_context;
    136136
    137137  _Thread_queue_Context_clear_priority_updates( queue_context );
  • cpukit/score/include/rtems/score/threadimpl.h

    r6cc83b32 r5b6c290  
    13341334 * @param[in] queue_context The thread queue context for the corresponding
    13351335 *   _Thread_Wait_release_critical().
    1336  *
    1337  * @see _Thread_queue_Context_initialize().
    13381336 */
    13391337RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire_critical(
     
    13981396)
    13991397{
    1400   _Thread_queue_Context_initialize( queue_context );
    14011398  _ISR_lock_ISR_disable( &queue_context->Lock_context.Lock_context );
    14021399  _Thread_Wait_acquire_critical( the_thread, queue_context );
  • cpukit/score/src/threadrestart.c

    r6cc83b32 r5b6c290  
    5858  Thread_queue_Context queue_context;
    5959
     60  _Thread_queue_Context_initialize( &queue_context );
     61  _Thread_queue_Context_clear_priority_updates( &queue_context );
    6062  _Thread_Wait_acquire( the_thread, &queue_context );
    61   _Thread_queue_Context_clear_priority_updates( &queue_context );
    6263
    6364  if ( priority < the_thread->Real_priority.priority ) {
     
    638639  );
    639640
     641  _Thread_queue_Context_initialize( &queue_context );
     642  _Thread_queue_Context_clear_priority_updates( &queue_context );
    640643  _Thread_State_acquire_critical( executing, lock_context );
    641644
     
    651654  _Thread_State_release( executing, lock_context );
    652655
    653   _Thread_queue_Context_clear_priority_updates( &queue_context );
    654656  _Thread_Wait_acquire_default( executing, lock_context );
    655657  _Thread_Priority_change(
  • cpukit/score/src/threadtimeout.c

    r6cc83b32 r5b6c290  
    3232  the_thread = RTEMS_CONTAINER_OF( watchdog, Thread_Control, Timer.Watchdog );
    3333
     34  _Thread_queue_Context_initialize( &queue_context );
     35  _Thread_queue_Context_clear_priority_updates( &queue_context );
    3436  _Thread_Wait_acquire( the_thread, &queue_context );
    35   _Thread_queue_Context_clear_priority_updates( &queue_context );
    3637
    3738  wait_flags = _Thread_Wait_flags_get( the_thread );
  • testsuites/smptests/smpscheduler03/init.c

    r6cc83b32 r5b6c290  
    5353)
    5454{
     55  _Thread_queue_Context_initialize(queue_context);
     56  _Thread_queue_Context_clear_priority_updates(queue_context);
    5557  _Thread_Wait_acquire(thread, queue_context);
    56   _Thread_queue_Context_clear_priority_updates(queue_context);
    5758  _Thread_Priority_change(
    5859    thread,
  • testsuites/sptests/spthreadq01/init.c

    r6cc83b32 r5b6c290  
    7272  rtems_id id;
    7373
     74  _Thread_queue_Context_initialize(&queue_context);
    7475  _Thread_Wait_acquire(ctx->master, &queue_context);
    7576  id = _Thread_Wait_get_id(ctx->master);
Note: See TracChangeset for help on using the changeset viewer.