summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/semrelease.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-03 08:15:21 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-06 12:57:07 +0200
commit3ad5f86cf6803204b98760cdce0c56ef6d79bccd (patch)
treeae018224b2cdda837bd174ad94397a5e043dc2ea /cpukit/rtems/src/semrelease.c
parenttftp: Use proper semaphore attr for mutex (diff)
downloadrtems-3ad5f86cf6803204b98760cdce0c56ef6d79bccd.tar.bz2
rtems: Fix no protocol mutex release
The Classic binary semaphores without a locking protocol (RTEMS_BINARY_SEMAPHORE) could be released by everyone, e.g. in contrast to the POSIX mutexes (all variants) or the Classic binary semphores with priority inheritance or ceiling, there was no owner check in the release path. This behaviour was a bit unexpected and not documented. Add an owner check to the release path. Update sptests/sp42 accordingly. This change has nothing to do with the simple binary semaphores (RTEMS_SIMPLE_BINARY_SEMAPHORE) which have no owner at all. Update #2725
Diffstat (limited to 'cpukit/rtems/src/semrelease.c')
-rw-r--r--cpukit/rtems/src/semrelease.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpukit/rtems/src/semrelease.c b/cpukit/rtems/src/semrelease.c
index ccd4e63d64..39c467da62 100644
--- a/cpukit/rtems/src/semrelease.c
+++ b/cpukit/rtems/src/semrelease.c
@@ -64,9 +64,10 @@ rtems_status_code rtems_semaphore_release( rtems_id id )
);
break;
case SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL:
- _CORE_recursive_mutex_Surrender_no_protocol_classic(
+ _CORE_recursive_mutex_Surrender_no_protocol(
&the_semaphore->Core_control.Mutex.Recursive,
_Semaphore_Get_operations( the_semaphore ),
+ executing,
&queue_context
);
status = STATUS_SUCCESSFUL;