Changeset 9b39bab in rtems


Ignore:
Timestamp:
02/20/98 20:23:57 (26 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
0799dec
Parents:
ee7f4e34
Message:

Modified to make it possible for an ISR to return a mutex which did
not use priority ceiling or priority inheritance protocols.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/score/src/coremutex.c

    ree7f4e34 r9b39bab  
    241241  executing = _Thread_Executing;
    242242
     243  /*
     244   *  The following code allows a thread (or ISR) other than the thread
     245   *  which acquired the mutex to release that mutex.  This is only
     246   *  allowed when the mutex in quetion is FIFO or simple Priority
     247   *  discipline.  But Priority Ceiling or Priority Inheritance mutexes
     248   *  must be released by the thread which acquired them.
     249   */
     250
    243251  if ( !_Objects_Are_ids_equal(
    244            _Thread_Executing->Object.id, the_mutex->holder_id ) )
    245     return( CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE );
     252           _Thread_Executing->Object.id, the_mutex->holder_id ) ) {
     253
     254    switch ( the_mutex->Attributes.discipline ) {
     255      case CORE_MUTEX_DISCIPLINES_FIFO:
     256      case CORE_MUTEX_DISCIPLINES_PRIORITY:
     257        break;
     258      case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
     259      case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
     260        return( CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE );
     261        break;
     262    }
     263  }
    246264
    247265  the_mutex->nest_count--;
  • cpukit/score/src/coremutex.c

    ree7f4e34 r9b39bab  
    241241  executing = _Thread_Executing;
    242242
     243  /*
     244   *  The following code allows a thread (or ISR) other than the thread
     245   *  which acquired the mutex to release that mutex.  This is only
     246   *  allowed when the mutex in quetion is FIFO or simple Priority
     247   *  discipline.  But Priority Ceiling or Priority Inheritance mutexes
     248   *  must be released by the thread which acquired them.
     249   */
     250
    243251  if ( !_Objects_Are_ids_equal(
    244            _Thread_Executing->Object.id, the_mutex->holder_id ) )
    245     return( CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE );
     252           _Thread_Executing->Object.id, the_mutex->holder_id ) ) {
     253
     254    switch ( the_mutex->Attributes.discipline ) {
     255      case CORE_MUTEX_DISCIPLINES_FIFO:
     256      case CORE_MUTEX_DISCIPLINES_PRIORITY:
     257        break;
     258      case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING:
     259      case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT:
     260        return( CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE );
     261        break;
     262    }
     263  }
    246264
    247265  the_mutex->nest_count--;
Note: See TracChangeset for help on using the changeset viewer.