From df49c60c9671e4a28e636964d744c1f59fb6cb68 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 12 Jun 2000 15:00:15 +0000 Subject: Merged from 4.5.0-beta3a --- cpukit/rtems/src/semdelete.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'cpukit/rtems/src/semdelete.c') diff --git a/cpukit/rtems/src/semdelete.c b/cpukit/rtems/src/semdelete.c index 1e9b165c71..079d9ed810 100644 --- a/cpukit/rtems/src/semdelete.c +++ b/cpukit/rtems/src/semdelete.c @@ -61,6 +61,12 @@ * error code - if unsuccessful */ +#if defined(RTEMS_MULTIPROCESSING) +#define SEMAPHORE_MP_OBJECT_WAS_DELETED _Semaphore_MP_Send_object_was_deleted +#else +#define SEMAPHORE_MP_OBJECT_WAS_DELETED NULL +#endif + rtems_status_code rtems_semaphore_delete( Objects_Id id ) @@ -81,32 +87,25 @@ rtems_status_code rtems_semaphore_delete( return RTEMS_INVALID_ID; case OBJECTS_LOCAL: - if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { - if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) ) { + if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { + if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) && + !_Attributes_Is_simple_binary_semaphore( + the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } - else - _CORE_mutex_Flush( - &the_semaphore->Core_control.mutex, -#if defined(RTEMS_MULTIPROCESSING) - _Semaphore_MP_Send_object_was_deleted, -#else - NULL, -#endif - CORE_MUTEX_WAS_DELETED - ); - } - else + _CORE_mutex_Flush( + &the_semaphore->Core_control.mutex, + SEMAPHORE_MP_OBJECT_WAS_DELETED, + CORE_MUTEX_WAS_DELETED + ); + } else { _CORE_semaphore_Flush( &the_semaphore->Core_control.semaphore, -#if defined(RTEMS_MULTIPROCESSING) - _Semaphore_MP_Send_object_was_deleted, -#else - NULL, -#endif + SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_SEMAPHORE_WAS_DELETED ); + } _Objects_Close( &_Semaphore_Information, &the_semaphore->Object ); -- cgit v1.2.3