Changeset 7ea9f1d in rtems


Ignore:
Timestamp:
Apr 3, 2000, 1:10:50 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
d2d4372d
Parents:
969525fe
Message:

Patch from Eric Norum <eric@…> so simple binary semaphores
can be deleted when held.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/rtems/src/semdelete.c

    r969525fe r7ea9f1d  
    6262 */
    6363
     64#if defined(RTEMS_MULTIPROCESSING)
     65#define SEMAPHORE_MP_WAS_DELETED       _Semaphore_MP_Send_object_was_deleted
     66#else
     67#define SEMAPHORE_MP_OBJECT_WAS_DELETED NULL
     68#endif
     69
    6470rtems_status_code rtems_semaphore_delete(
    6571  Objects_Id id
     
    8288
    8389    case OBJECTS_LOCAL:
    84       if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
    85         if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) ) {
     90      if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
     91        if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) &&
     92             !_Attributes_Is_simple_binary_semaphore(
     93                 the_semaphore->attribute_set ) ) {
    8694          _Thread_Enable_dispatch();
    8795          return RTEMS_RESOURCE_IN_USE;
    8896        }
    89         else
    90           _CORE_mutex_Flush(
    91             &the_semaphore->Core_control.mutex,
    92 #if defined(RTEMS_MULTIPROCESSING)
    93             _Semaphore_MP_Send_object_was_deleted,
    94 #else
    95             NULL,
    96 #endif
    97             CORE_MUTEX_WAS_DELETED
    98           );
    99       }
    100       else
     97        _CORE_mutex_Flush(
     98          &the_semaphore->Core_control.mutex,
     99          SEMAPHORE_MP_OBJECT_WAS_DELETED,
     100          CORE_MUTEX_WAS_DELETED
     101        );
     102      } else {
    101103        _CORE_semaphore_Flush(
    102104          &the_semaphore->Core_control.semaphore,
    103 #if defined(RTEMS_MULTIPROCESSING)
    104           _Semaphore_MP_Send_object_was_deleted,
    105 #else
    106           NULL,
    107 #endif
     105          SEMAPHORE_MP_OBJECT_WAS_DELETED,
    108106          CORE_SEMAPHORE_WAS_DELETED
    109107        );
     108     }
    110109
    111110      _Objects_Close( &_Semaphore_Information, &the_semaphore->Object );
Note: See TracChangeset for help on using the changeset viewer.