Changeset bbe654af in rtems


Ignore:
Timestamp:
Apr 19, 2016, 4:18:52 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
48b04fc3
Parents:
b8bdced1
git-author:
Sebastian Huber <sebastian.huber@…> (04/19/16 04:18:52)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/21/16 05:29:39)
Message:

score: Add and use _CORE_mutex_Acquire_critical()

Add and use _CORE_mutex_Release().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/coremuteximpl.h

    rb8bdced1 rbbe654af  
    112112{
    113113  _Thread_queue_Destroy( &the_mutex->Wait_queue );
     114}
     115
     116RTEMS_INLINE_ROUTINE void _CORE_mutex_Acquire_critical(
     117  CORE_mutex_Control *the_mutex,
     118  ISR_lock_Context   *lock_context
     119)
     120{
     121  _Thread_queue_Acquire_critical( &the_mutex->Wait_queue, lock_context );
     122}
     123
     124RTEMS_INLINE_ROUTINE void _CORE_mutex_Release(
     125  CORE_mutex_Control *the_mutex,
     126  ISR_lock_Context   *lock_context
     127)
     128{
     129  _Thread_queue_Release( &the_mutex->Wait_queue, lock_context );
    114130}
    115131
     
    246262    );
    247263  }
    248   _Thread_queue_Acquire_critical( &the_mutex->Wait_queue, lock_context );
     264  _CORE_mutex_Acquire_critical( the_mutex, lock_context );
    249265  if ( _CORE_mutex_Seize_interrupt_trylock( the_mutex, executing, lock_context ) ) {
    250266    if ( !wait ) {
    251       _Thread_queue_Release( &the_mutex->Wait_queue, lock_context );
     267      _CORE_mutex_Release( the_mutex, lock_context );
    252268      executing->Wait.return_code =
    253269        CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT;
     
    463479
    464480    if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
    465       _Thread_queue_Release( &the_mutex->Wait_queue, lock_context );
     481      _CORE_mutex_Release( the_mutex, lock_context );
    466482      return 0;
    467483    } /* else must be CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING
     
    477493      current = executing->current_priority;
    478494      if ( current == ceiling ) {
    479         _Thread_queue_Release( &the_mutex->Wait_queue, lock_context );
     495        _CORE_mutex_Release( the_mutex, lock_context );
    480496        return 0;
    481497      }
     
    485501
    486502        cpu_self = _Thread_Dispatch_disable_critical( lock_context );
    487         _Thread_queue_Release( &the_mutex->Wait_queue, lock_context );
     503        _CORE_mutex_Release( the_mutex, lock_context );
    488504        _Thread_Raise_priority( executing, ceiling );
    489505        _Thread_Dispatch_enable( cpu_self );
     
    495511        the_mutex->nest_count = 0;     /* undo locking above */
    496512        executing->resource_count--;   /* undo locking above */
    497         _Thread_queue_Release( &the_mutex->Wait_queue, lock_context );
     513        _CORE_mutex_Release( the_mutex, lock_context );
    498514        return 0;
    499515      }
     
    511527      case CORE_MUTEX_NESTING_ACQUIRES:
    512528        the_mutex->nest_count++;
    513         _Thread_queue_Release( &the_mutex->Wait_queue, lock_context );
     529        _CORE_mutex_Release( the_mutex, lock_context );
    514530        return 0;
    515531      #if defined(RTEMS_POSIX_API)
    516532        case CORE_MUTEX_NESTING_IS_ERROR:
    517533          executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED;
    518           _Thread_queue_Release( &the_mutex->Wait_queue, lock_context );
     534          _CORE_mutex_Release( the_mutex, lock_context );
    519535          return 0;
    520536      #endif
Note: See TracChangeset for help on using the changeset viewer.