Changeset 114e408 in rtems


Ignore:
Timestamp:
Aug 22, 2016, 11:17:05 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
e41308ea
Parents:
db563698
git-author:
Sebastian Huber <sebastian.huber@…> (08/22/16 11:17:05)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/08/16 07:55:26)
Message:

score: Simplify thread queue acquire/release

Location:
cpukit
Files:
16 edited

Legend:

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

    rdb563698 r114e408  
    6969)
    7070{
    71   _Thread_queue_Acquire_critical(
    72     &the_cond->Wait_queue,
    73     &queue_context->Lock_context
    74   );
     71  _Thread_queue_Acquire_critical( &the_cond->Wait_queue, queue_context );
    7572}
    7673
     
    8077)
    8178{
    82   _Thread_queue_Release( &the_cond->Wait_queue, &queue_context->Lock_context );
     79  _Thread_queue_Release( &the_cond->Wait_queue, queue_context );
    8380}
    8481
  • cpukit/posix/include/rtems/posix/psignalimpl.h

    rdb563698 r114e408  
    7878)
    7979{
    80   _Thread_queue_Acquire(
    81     &_POSIX_signals_Wait_queue,
    82     &queue_context->Lock_context
    83   );
     80  _Thread_queue_Acquire( &_POSIX_signals_Wait_queue, queue_context );
    8481}
    8582
     
    8885)
    8986{
    90   _Thread_queue_Release(
    91     &_POSIX_signals_Wait_queue,
    92     &queue_context->Lock_context
    93   );
     87  _Thread_queue_Release( &_POSIX_signals_Wait_queue, queue_context );
    9488}
    9589
  • cpukit/rtems/src/semdelete.c

    rdb563698 r114e408  
    4747  _Thread_queue_Acquire_critical(
    4848    &the_semaphore->Core_control.Wait_queue,
    49     &queue_context.Lock_context
     49    &queue_context
    5050  );
    5151
     
    8282    _Thread_queue_Release(
    8383      &the_semaphore->Core_control.Wait_queue,
    84       &queue_context.Lock_context
     84      &queue_context
    8585    );
    8686    _Objects_Allocator_unlock();
  • cpukit/rtems/src/semflush.c

    rdb563698 r114e408  
    4040  _Thread_queue_Acquire_critical(
    4141    &the_semaphore->Core_control.Wait_queue,
    42     &queue_context.Lock_context
     42    &queue_context
    4343  );
    4444  _Thread_queue_Context_set_MP_callout(
     
    5252      _Thread_queue_Release(
    5353        &the_semaphore->Core_control.Wait_queue,
    54         &queue_context.Lock_context
     54        &queue_context
    5555      );
    5656      return RTEMS_NOT_DEFINED;
  • cpukit/rtems/src/semsetpriority.c

    rdb563698 r114e408  
    5555  _Thread_queue_Acquire_critical(
    5656    &the_semaphore->Core_control.Wait_queue,
    57     &queue_context->Lock_context
     57    queue_context
    5858  );
    5959
     
    109109  _Thread_queue_Release(
    110110    &the_semaphore->Core_control.Wait_queue,
    111     &queue_context->Lock_context
     111    queue_context
    112112  );
    113113
  • cpukit/score/include/rtems/score/corebarrierimpl.h

    rdb563698 r114e408  
    6060)
    6161{
    62   _Thread_queue_Acquire_critical(
    63     &the_barrier->Wait_queue,
    64     &queue_context->Lock_context
    65   );
     62  _Thread_queue_Acquire_critical( &the_barrier->Wait_queue, queue_context );
    6663}
    6764
     
    7168)
    7269{
    73   _Thread_queue_Release(
    74     &the_barrier->Wait_queue,
    75     &queue_context->Lock_context
    76   );
     70  _Thread_queue_Release( &the_barrier->Wait_queue, queue_context );
    7771}
    7872
  • cpukit/score/include/rtems/score/coremsgimpl.h

    rdb563698 r114e408  
    314314)
    315315{
    316   _Thread_queue_Acquire(
    317     &the_message_queue->Wait_queue,
    318     &queue_context->Lock_context
    319   );
     316  _Thread_queue_Acquire( &the_message_queue->Wait_queue, queue_context );
    320317}
    321318
     
    325322)
    326323{
    327   _Thread_queue_Acquire_critical(
    328     &the_message_queue->Wait_queue,
    329     &queue_context->Lock_context
    330   );
     324  _Thread_queue_Acquire_critical( &the_message_queue->Wait_queue, queue_context );
    331325}
    332326
     
    336330)
    337331{
    338   _Thread_queue_Release(
    339     &the_message_queue->Wait_queue,
    340     &queue_context->Lock_context
    341   );
     332  _Thread_queue_Release( &the_message_queue->Wait_queue, queue_context );
    342333}
    343334
  • cpukit/score/include/rtems/score/coremuteximpl.h

    rdb563698 r114e408  
    5757)
    5858{
    59   _Thread_queue_Acquire_critical(
    60     &the_mutex->Wait_queue,
    61     &queue_context->Lock_context
    62   );
     59  _Thread_queue_Acquire_critical( &the_mutex->Wait_queue, queue_context );
    6360}
    6461
     
    6865)
    6966{
    70   _Thread_queue_Release(
    71     &the_mutex->Wait_queue,
    72     &queue_context->Lock_context
    73   );
     67  _Thread_queue_Release( &the_mutex->Wait_queue, queue_context );
    7468}
    7569
  • cpukit/score/include/rtems/score/corerwlockimpl.h

    rdb563698 r114e408  
    7272)
    7373{
    74   _Thread_queue_Acquire_critical(
    75     &the_rwlock->Wait_queue,
    76     &queue_context->Lock_context
    77   );
     74  _Thread_queue_Acquire_critical( &the_rwlock->Wait_queue, queue_context );
    7875}
    7976
     
    8380)
    8481{
    85   _Thread_queue_Release(
    86     &the_rwlock->Wait_queue,
    87     &queue_context->Lock_context
    88   );
     82  _Thread_queue_Release( &the_rwlock->Wait_queue, queue_context );
    8983}
    9084
  • cpukit/score/include/rtems/score/coresemimpl.h

    rdb563698 r114e408  
    5959)
    6060{
    61   _Thread_queue_Acquire_critical(
    62     &the_semaphore->Wait_queue,
    63     &queue_context->Lock_context
    64   );
     61  _Thread_queue_Acquire_critical( &the_semaphore->Wait_queue, queue_context );
    6562}
    6663
     
    7067)
    7168{
    72   _Thread_queue_Release(
    73     &the_semaphore->Wait_queue,
    74     &queue_context->Lock_context
    75   );
     69  _Thread_queue_Release( &the_semaphore->Wait_queue, queue_context );
    7670}
    7771
  • cpukit/score/include/rtems/score/mrspimpl.h

    rdb563698 r114e408  
    6767)
    6868{
    69   _Thread_queue_Acquire_critical(
    70     &mrsp->Wait_queue,
    71     &queue_context->Lock_context
    72   );
     69  _Thread_queue_Acquire_critical( &mrsp->Wait_queue, queue_context );
    7370}
    7471
     
    7875)
    7976{
    80   _Thread_queue_Release( &mrsp->Wait_queue, &queue_context->Lock_context );
     77  _Thread_queue_Release( &mrsp->Wait_queue, queue_context );
    8178}
    8279
  • cpukit/score/include/rtems/score/threadimpl.h

    rdb563698 r114e408  
    369369)
    370370{
    371   _Thread_queue_Acquire_critical( &the_thread->Join_queue, lock_context );
     371  _Thread_queue_Do_acquire_critical( &the_thread->Join_queue, lock_context );
    372372}
    373373
     
    377377)
    378378{
    379   _Thread_queue_Acquire( &the_thread->Join_queue, lock_context );
     379  _ISR_lock_ISR_disable( lock_context );
     380  _Thread_State_acquire_critical( the_thread, lock_context );
    380381}
    381382
     
    398399)
    399400{
    400   _Thread_queue_Release_critical( &the_thread->Join_queue, lock_context );
     401  _Thread_queue_Do_release_critical( &the_thread->Join_queue, lock_context );
    401402}
    402403
     
    406407)
    407408{
    408   _Thread_queue_Release( &the_thread->Join_queue, lock_context );
     409  _Thread_State_release_critical( the_thread, lock_context );
     410  _ISR_lock_ISR_enable( lock_context );
    409411}
    410412
  • cpukit/score/include/rtems/score/threadqimpl.h

    rdb563698 r114e408  
    351351}
    352352
    353 RTEMS_INLINE_ROUTINE void _Thread_queue_Acquire_critical(
     353RTEMS_INLINE_ROUTINE void _Thread_queue_Do_acquire_critical(
    354354  Thread_queue_Control *the_thread_queue,
    355355  ISR_lock_Context     *lock_context
     
    366366}
    367367
     368RTEMS_INLINE_ROUTINE void _Thread_queue_Acquire_critical(
     369  Thread_queue_Control *the_thread_queue,
     370  Thread_queue_Context *queue_context
     371)
     372{
     373  _Thread_queue_Do_acquire_critical(
     374    the_thread_queue,
     375    &queue_context->Lock_context
     376  );
     377}
     378
    368379RTEMS_INLINE_ROUTINE void _Thread_queue_Acquire(
    369380  Thread_queue_Control *the_thread_queue,
    370   ISR_lock_Context     *lock_context
    371 )
    372 {
    373   _ISR_lock_ISR_disable( lock_context );
    374   _Thread_queue_Acquire_critical( the_thread_queue, lock_context );
     381  Thread_queue_Context *queue_context
     382)
     383{
     384  _ISR_lock_ISR_disable( &queue_context->Lock_context );
     385  _Thread_queue_Acquire_critical( the_thread_queue, queue_context );
    375386}
    376387
     
    388399#endif
    389400
    390 RTEMS_INLINE_ROUTINE void _Thread_queue_Release_critical(
     401RTEMS_INLINE_ROUTINE void _Thread_queue_Do_release_critical(
    391402  Thread_queue_Control *the_thread_queue,
    392403  ISR_lock_Context     *lock_context
     
    405416}
    406417
     418RTEMS_INLINE_ROUTINE void _Thread_queue_Release_critical(
     419  Thread_queue_Control *the_thread_queue,
     420  Thread_queue_Context *queue_context
     421)
     422{
     423  _Thread_queue_Do_release_critical(
     424    the_thread_queue,
     425    &queue_context->Lock_context
     426  );
     427}
     428
    407429RTEMS_INLINE_ROUTINE void _Thread_queue_Release(
    408430  Thread_queue_Control *the_thread_queue,
    409   ISR_lock_Context     *lock_context
    410 )
    411 {
    412   _Thread_queue_Release_critical( the_thread_queue, lock_context );
    413   _ISR_lock_ISR_enable( lock_context );
     431  Thread_queue_Context *queue_context
     432)
     433{
     434  _Thread_queue_Release_critical( the_thread_queue, queue_context );
     435  _ISR_lock_ISR_enable( &queue_context->Lock_context );
    414436}
    415437
     
    542564
    543565  _Thread_queue_Context_initialize( &queue_context );
    544   _Thread_queue_Acquire( the_thread_queue, &queue_context.Lock_context );
     566  _Thread_queue_Acquire( the_thread_queue, &queue_context );
    545567  _Thread_queue_Context_set_expected_level( &queue_context, expected_level );
    546568  if ( discipline == WATCHDOG_ABSOLUTE ) {
     
    663685 *
    664686 *   _Thread_queue_Context_initialize( &queue_context, NULL );
    665  *   _Thread_queue_Acquire( &mutex->Queue, &queue_context.Lock_context );
     687 *   _Thread_queue_Acquire( &mutex->Queue, queue_context );
    666688 *
    667689 *   first = _Thread_queue_First_locked( &mutex->Queue );
  • cpukit/score/src/threadqenqueue.c

    rdb563698 r114e408  
    642642  _Thread_queue_Context_initialize( &queue_context );
    643643  _Thread_queue_Context_set_MP_callout( &queue_context, mp_callout );
    644   _Thread_queue_Acquire( the_thread_queue, &queue_context.Lock_context );
     644  _Thread_queue_Acquire( the_thread_queue, &queue_context );
    645645
    646646  the_thread = _Thread_queue_First_locked( the_thread_queue, operations );
     
    654654    );
    655655  } else {
    656     _Thread_queue_Release( the_thread_queue, &queue_context.Lock_context );
     656    _Thread_queue_Release( the_thread_queue, &queue_context );
    657657  }
    658658
  • cpukit/score/src/threadqfirst.c

    rdb563698 r114e408  
    2626)
    2727{
    28   Thread_Control   *the_thread;
    29   ISR_lock_Context  lock_context;
     28  Thread_Control       *the_thread;
     29  Thread_queue_Context  queue_context;
    3030
    31   _Thread_queue_Acquire( the_thread_queue, &lock_context );
     31  _Thread_queue_Acquire( the_thread_queue, &queue_context );
    3232  the_thread = _Thread_queue_First_locked( the_thread_queue, operations );
    33   _Thread_queue_Release( the_thread_queue, &lock_context );
     33  _Thread_queue_Release( the_thread_queue, &queue_context );
    3434
    3535  return the_thread;
  • cpukit/score/src/threadrestart.c

    rdb563698 r114e408  
    120120
    121121  _Thread_queue_Context_initialize( &join_context.Base );
    122   _Thread_queue_Acquire(
    123     &the_thread->Join_queue,
    124     &join_context.Base.Lock_context
    125   );
     122  _Thread_queue_Acquire( &the_thread->Join_queue, &join_context.Base );
    126123  _Thread_queue_Flush_critical(
    127124    &the_thread->Join_queue.Queue,
Note: See TracChangeset for help on using the changeset viewer.