Changeset c09db57 in rtems


Ignore:
Timestamp:
Nov 28, 2016, 12:28:32 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
6a1b9e4
Parents:
9bf9068
git-author:
Sebastian Huber <sebastian.huber@…> (11/28/16 12:28:32)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/28/16 15:08:43)
Message:

score: Fix thread queue context initialization

Initialize the thread queue context with invalid data in debug
configurations to catch missing set up steps.

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/include/rtems/posix/posixapi.h

    r9bf9068 rc09db57  
    9090 * identifier.
    9191 *
    92  * Generates a function body to get the object for the specified indentifier.
     92 * Generates a function body to get the object for the specified identifier.
    9393 * Performs automatic initialization if requested and necessary.  This is an
    9494 * ugly macro, since C lacks support for templates.
     
    106106    return NULL; \
    107107  } \
     108  _Thread_queue_Initialize( queue_context ); \
    108109  the_object = _Objects_Get( \
    109110    (Objects_Id) *id, \
  • cpukit/posix/src/mutexsetprioceiling.c

    r9bf9068 rc09db57  
    6868      Per_CPU_Control      *cpu_self;
    6969
    70       _Thread_queue_Context_clear_priority_updates( &queue_context );
    7170      _CORE_ceiling_mutex_Set_priority(
    7271        &the_mutex->Mutex,
  • cpukit/posix/src/pthread.c

    r9bf9068 rc09db57  
    9292  the_thread = api->thread;
    9393
     94  _Thread_Wait_acquire( the_thread, &queue_context );
    9495  _Thread_queue_Context_clear_priority_updates( &queue_context );
    95   _Thread_Wait_acquire( the_thread, &queue_context );
    9696
    9797  if ( _Priority_Node_is_active( &api->Sporadic.Low_priority ) ) {
     
    123123  api = the_thread->API_Extensions[ THREAD_API_POSIX ];
    124124
     125  _Thread_Wait_acquire( the_thread, &queue_context );
    125126  _Thread_queue_Context_clear_priority_updates( &queue_context );
    126   _Thread_Wait_acquire( the_thread, &queue_context );
    127127
    128128  /*
  • cpukit/posix/src/pthreadgetschedparam.c

    r9bf9068 rc09db57  
    5454  api = the_thread->API_Extensions[ THREAD_API_POSIX ];
    5555
     56  _Thread_queue_Context_initialize( &queue_context );
    5657  _Thread_Wait_acquire_critical( the_thread, &queue_context );
    5758
  • cpukit/score/include/rtems/score/coremuteximpl.h

    r9bf9068 rc09db57  
    254254  if ( owner != NULL ) {
    255255    _Thread_Wait_acquire( owner, queue_context );
     256    _Thread_queue_Context_clear_priority_updates( queue_context );
    256257    _Thread_Priority_change(
    257258      owner,
  • cpukit/score/include/rtems/score/threadqimpl.h

    r9bf9068 rc09db57  
    8888{
    8989#if defined(RTEMS_DEBUG)
    90   memset( queue_context, 0, sizeof( *queue_context ) );
    91   queue_context->enqueue_callout = _Thread_queue_Enqueue_do_nothing;
    92   queue_context->deadlock_callout = _Thread_queue_Deadlock_fatal;
     90  memset( queue_context, 0x7f, sizeof( *queue_context ) );
     91#if defined(RTEMS_SMP)
     92  _Chain_Initialize_node( &queue_context->Lock_context.Wait.Gate.Node );
     93#endif
    9394#else
    9495  (void) queue_context;
  • cpukit/score/src/threadqenqueue.c

    r9bf9068 rc09db57  
    421421  bool             success;
    422422
     423  _Assert( (uint8_t) (uintptr_t) queue_context->enqueue_callout != 0x7f );
     424  _Assert( (uint8_t) queue_context->timeout_discipline != 0x7f );
     425
    423426#if defined(RTEMS_MULTIPROCESSING)
    424427  if ( _Thread_MP_Is_receive( the_thread ) && the_thread->receive_packet ) {
     
    434437    _Thread_queue_Queue_release( queue, &queue_context->Lock_context.Lock_context );
    435438    _Thread_Wait_tranquilize( the_thread );
     439    _Assert( (uint8_t) (uintptr_t) queue_context->deadlock_callout != 0x7f );
    436440    ( *queue_context->deadlock_callout )( the_thread );
    437441    return;
     
    598602)
    599603{
     604  _Thread_queue_Context_clear_priority_updates( queue_context );
    600605#if defined(RTEMS_MULTIPROCESSING)
    601606  _Thread_queue_MP_set_callout( the_thread, queue_context );
  • cpukit/score/src/threadrestart.c

    r9bf9068 rc09db57  
    5858  Thread_queue_Context queue_context;
    5959
     60  _Thread_Wait_acquire( the_thread, &queue_context );
    6061  _Thread_queue_Context_clear_priority_updates( &queue_context );
    61   _Thread_Wait_acquire( the_thread, &queue_context );
    6262
    6363  if ( priority < the_thread->Real_priority.priority ) {
  • cpukit/score/src/threadtimeout.c

    r9bf9068 rc09db57  
    3232  the_thread = RTEMS_CONTAINER_OF( watchdog, Thread_Control, Timer.Watchdog );
    3333
     34  _Thread_Wait_acquire( the_thread, &queue_context );
    3435  _Thread_queue_Context_clear_priority_updates( &queue_context );
    35   _Thread_Wait_acquire( the_thread, &queue_context );
    3636
    3737  wait_flags = _Thread_Wait_flags_get( the_thread );
  • testsuites/smptests/smpscheduler03/init.c

    r9bf9068 rc09db57  
    5353)
    5454{
     55  _Thread_Wait_acquire(thread, queue_context);
    5556  _Thread_queue_Context_clear_priority_updates(queue_context);
    56   _Thread_Wait_acquire(thread, queue_context);
    5757  _Thread_Priority_change(
    5858    thread,
Note: See TracChangeset for help on using the changeset viewer.