summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/semdelete.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-26 22:29:56 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-30 16:16:22 +0200
commit09c5ca4cb4f30ba9e0c3c3915a70af7ff3916ec0 (patch)
tree70b4e6167e38902fce2ffebbf343df6ac8a6fe06 /cpukit/rtems/src/semdelete.c
parentscore: Add semaphore variants (diff)
downloadrtems-09c5ca4cb4f30ba9e0c3c3915a70af7ff3916ec0.tar.bz2
score: Simplify CORE mutex
Remove superfluous support for simple binary semaphores. With this we can get rid of the CORE_MUTEX_NESTING_BLOCKS variant.
Diffstat (limited to 'cpukit/rtems/src/semdelete.c')
-rw-r--r--cpukit/rtems/src/semdelete.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/cpukit/rtems/src/semdelete.c b/cpukit/rtems/src/semdelete.c
index 45c356f452..908c178593 100644
--- a/cpukit/rtems/src/semdelete.c
+++ b/cpukit/rtems/src/semdelete.c
@@ -19,7 +19,6 @@
#endif
#include <rtems/rtems/semimpl.h>
-#include <rtems/rtems/attrimpl.h>
#include <rtems/rtems/statusimpl.h>
rtems_status_code rtems_semaphore_delete(
@@ -28,7 +27,6 @@ rtems_status_code rtems_semaphore_delete(
{
Semaphore_Control *the_semaphore;
Thread_queue_Context queue_context;
- rtems_attribute attribute_set;
Status_Control status;
_Objects_Allocator_lock();
@@ -46,8 +44,6 @@ rtems_status_code rtems_semaphore_delete(
return RTEMS_INVALID_ID;
}
- attribute_set = the_semaphore->attribute_set;
-
_Thread_queue_Acquire_critical(
&the_semaphore->Core_control.Wait_queue,
&queue_context.Lock_context
@@ -55,10 +51,7 @@ rtems_status_code rtems_semaphore_delete(
switch ( the_semaphore->variant ) {
case SEMAPHORE_VARIANT_MUTEX:
- if (
- _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex )
- && !_Attributes_Is_simple_binary_semaphore( attribute_set )
- ) {
+ if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) ) {
status = STATUS_RESOURCE_IN_USE;
} else {
status = STATUS_SUCCESSFUL;
@@ -71,7 +64,10 @@ rtems_status_code rtems_semaphore_delete(
break;
#endif
default:
- _Assert( the_semaphore->variant == SEMAPHORE_VARIANT_COUNTING );
+ _Assert(
+ the_semaphore->variant == SEMAPHORE_VARIANT_SIMPLE_BINARY
+ || the_semaphore->variant == SEMAPHORE_VARIANT_COUNTING
+ );
status = STATUS_SUCCESSFUL;
break;
}
@@ -102,7 +98,10 @@ rtems_status_code rtems_semaphore_delete(
break;
#endif
default:
- _Assert( the_semaphore->variant == SEMAPHORE_VARIANT_COUNTING );
+ _Assert(
+ the_semaphore->variant == SEMAPHORE_VARIANT_SIMPLE_BINARY
+ || the_semaphore->variant == SEMAPHORE_VARIANT_COUNTING
+ );
_CORE_semaphore_Destroy(
&the_semaphore->Core_control.semaphore,
_Semaphore_Get_operations( the_semaphore ),