Changeset 07332ae in rtems


Ignore:
Timestamp:
Aug 22, 2013, 1:20:06 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
396f644
Parents:
f4804efa
git-author:
Sebastian Huber <sebastian.huber@…> (08/22/13 13:20:06)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/23/13 10:54:03)
Message:

score: _Thread_queue_Enqueue_with_handler()

Add thread parameter to _Thread_queue_Enqueue_with_handler() to avoid
access to global _Thread_Executing.

Location:
cpukit
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/condwaitsupp.c

    rf4804efa r07332ae  
    7676        executing->Wait.id          = *cond;
    7777
    78         _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout );
     78        _Thread_queue_Enqueue( &the_cond->Wait_queue, executing, timeout );
    7979
    8080        _Objects_Put( &the_cond->Object );
  • cpukit/posix/src/pthreadjoin.c

    rf4804efa r07332ae  
    7272        executing->Wait.return_argument = &return_pointer;
    7373        _Thread_queue_Enter_critical_section( &api->Join_List );
    74         _Thread_queue_Enqueue( &api->Join_List, WATCHDOG_NO_TIMEOUT );
     74        _Thread_queue_Enqueue(
     75          &api->Join_List,
     76          executing,
     77          WATCHDOG_NO_TIMEOUT
     78        );
    7579      }
    7680      _Objects_Put( &the_thread->Object );
  • cpukit/posix/src/sigtimedwait.c

    rf4804efa r07332ae  
    158158    _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue );
    159159    _ISR_Enable( level );
    160     _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval );
     160    _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, executing, interval );
    161161  _Thread_Enable_dispatch();
    162162
  • cpukit/rtems/src/regiongetsegment.c

    rf4804efa r07332ae  
    8686            _Thread_queue_Enter_critical_section( &the_region->Wait_queue );
    8787
    88             _Thread_queue_Enqueue( &the_region->Wait_queue, timeout );
     88            _Thread_queue_Enqueue(
     89              &the_region->Wait_queue,
     90              executing,
     91              timeout
     92            );
    8993
    9094            _Objects_Put( &the_region->Object );
  • cpukit/score/include/rtems/score/coresemimpl.h

    rf4804efa r07332ae  
    242242  _ISR_Enable( level );
    243243
    244   _Thread_queue_Enqueue( &the_semaphore->Wait_queue, timeout );
     244  _Thread_queue_Enqueue( &the_semaphore->Wait_queue, executing, timeout );
    245245  _Thread_Enable_dispatch();
    246246}
  • cpukit/score/include/rtems/score/threadqimpl.h

    rf4804efa r07332ae  
    8484 *  the_thread_queue with an optional timeout.
    8585 */
    86 #define _Thread_queue_Enqueue( _the_thread_queue, _timeout ) \
     86#define _Thread_queue_Enqueue( _the_thread_queue, _the_thread, _timeout ) \
    8787  _Thread_queue_Enqueue_with_handler( \
    8888    _the_thread_queue, \
     89    _the_thread, \
    8990    _timeout, \
    9091    _Thread_queue_Timeout )
     
    9798 *
    9899 *  @param[in] the_thread_queue pointer to threadq
     100 *  @param[in] the_thread the thread to enqueue
    99101 *  @param[in] timeout interval to wait
    100102 *
     
    103105 */
    104106void _Thread_queue_Enqueue_with_handler(
    105   Thread_queue_Control*        the_thread_queue,
    106   Watchdog_Interval            timeout,
    107   Thread_queue_Timeout_callout handler
     107  Thread_queue_Control         *the_thread_queue,
     108  Thread_Control               *the_thread,
     109  Watchdog_Interval             timeout,
     110  Thread_queue_Timeout_callout  handler
    108111);
    109112
  • cpukit/score/src/corebarrierwait.c

    rf4804efa r07332ae  
    5252  _ISR_Enable( level );
    5353
    54   _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout );
     54  _Thread_queue_Enqueue( &the_barrier->Wait_queue, executing, timeout );
    5555}
  • cpukit/score/src/coremsgseize.c

    rf4804efa r07332ae  
    122122  _ISR_Enable( level );
    123123
    124   _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
     124  _Thread_queue_Enqueue( &the_message_queue->Wait_queue, executing, timeout );
    125125}
  • cpukit/score/src/coremsgsubmit.c

    rf4804efa r07332ae  
    131131      _ISR_Enable( level );
    132132
    133       _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
     133      _Thread_queue_Enqueue(
     134        &the_message_queue->Wait_queue,
     135        executing,
     136        timeout
     137      );
    134138    }
    135139
  • cpukit/score/src/coremutexseize.c

    rf4804efa r07332ae  
    6666
    6767  the_mutex->blocked_count++;
    68   _Thread_queue_Enqueue( &the_mutex->Wait_queue, timeout );
     68  _Thread_queue_Enqueue( &the_mutex->Wait_queue, executing, timeout );
    6969
    7070  _Thread_Enable_dispatch();
  • cpukit/score/src/corerwlockobtainread.c

    rf4804efa r07332ae  
    8787    _Thread_queue_Enqueue_with_handler(
    8888       &the_rwlock->Wait_queue,
     89       executing,
    8990       timeout,
    9091       _CORE_RWLock_Timeout
  • cpukit/score/src/corerwlockobtainwrite.c

    rf4804efa r07332ae  
    7777    _Thread_queue_Enqueue_with_handler(
    7878       &the_rwlock->Wait_queue,
     79       executing,
    7980       timeout,
    8081       _CORE_RWLock_Timeout
  • cpukit/score/src/coresemseize.c

    rf4804efa r07332ae  
    6464  executing->Wait.id    = id;
    6565  _ISR_Enable( level );
    66   _Thread_queue_Enqueue( &the_semaphore->Wait_queue, timeout );
     66  _Thread_queue_Enqueue( &the_semaphore->Wait_queue, executing, timeout );
    6767}
    6868#endif
  • cpukit/score/src/mpci.c

    rf4804efa r07332ae  
    191191)
    192192{
    193   the_packet->source_tid      = _Thread_Executing->Object.id;
    194   the_packet->source_priority = _Thread_Executing->current_priority;
     193  Thread_Control *executing = _Thread_Executing;
     194
     195  the_packet->source_tid      = executing->Object.id;
     196  the_packet->source_priority = executing->current_priority;
    195197  the_packet->to_convert =
    196198     ( the_packet->to_convert - sizeof(MP_packet_Prefix) ) / sizeof(uint32_t);
    197199
    198   _Thread_Executing->Wait.id = the_packet->id;
    199 
    200   _Thread_Executing->Wait.queue = &_MPCI_Remote_blocked_threads;
     200  executing->Wait.id = the_packet->id;
     201
     202  executing->Wait.queue = &_MPCI_Remote_blocked_threads;
    201203
    202204  _Thread_Disable_dispatch();
     
    213215        the_packet->timeout = _MPCI_table->default_timeout;
    214216
    215     _Thread_queue_Enqueue( &_MPCI_Remote_blocked_threads, the_packet->timeout );
    216 
    217     _Thread_Executing->current_state =
    218       _States_Set( extra_state, _Thread_Executing->current_state );
     217    _Thread_queue_Enqueue(
     218      &_MPCI_Remote_blocked_threads,
     219      executing,
     220      the_packet->timeout
     221    );
     222
     223    executing->current_state =
     224      _States_Set( extra_state, executing->current_state );
    219225
    220226  _Thread_Enable_dispatch();
    221227
    222   return _Thread_Executing->Wait.return_code;
     228  return executing->Wait.return_code;
    223229}
    224230
  • cpukit/score/src/threadqenqueue.c

    rf4804efa r07332ae  
    2929void _Thread_queue_Enqueue_with_handler(
    3030  Thread_queue_Control         *the_thread_queue,
     31  Thread_Control               *the_thread,
    3132  Watchdog_Interval             timeout,
    3233  Thread_queue_Timeout_callout  handler
    3334)
    3435{
    35   Thread_Control                   *the_thread;
    3636  ISR_Level                         level;
    3737  Thread_blocking_operation_States  sync_state;
     
    4141    ISR_Level *
    4242  );
    43 
    44   the_thread = _Thread_Executing;
    4543
    4644#if defined(RTEMS_MULTIPROCESSING)
Note: See TracChangeset for help on using the changeset viewer.