summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/semdelete.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-06-12 15:00:15 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-06-12 15:00:15 +0000
commitdf49c60c9671e4a28e636964d744c1f59fb6cb68 (patch)
treeeabd85e189514ad412a35414ba5d483dcda3ef1f /cpukit/rtems/src/semdelete.c
parentPurged as many egcs references as possible. (diff)
downloadrtems-df49c60c9671e4a28e636964d744c1f59fb6cb68.tar.bz2
Merged from 4.5.0-beta3a
Diffstat (limited to 'cpukit/rtems/src/semdelete.c')
-rw-r--r--cpukit/rtems/src/semdelete.c37
1 files changed, 18 insertions, 19 deletions
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 );