summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/semrelease.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/rtems/src/semrelease.c')
-rw-r--r--cpukit/rtems/src/semrelease.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/cpukit/rtems/src/semrelease.c b/cpukit/rtems/src/semrelease.c
index ff4e792b92..2c4be04c78 100644
--- a/cpukit/rtems/src/semrelease.c
+++ b/cpukit/rtems/src/semrelease.c
@@ -73,12 +73,24 @@ rtems_status_code rtems_semaphore_release(
Objects_Locations location;
CORE_mutex_Status mutex_status;
CORE_semaphore_Status semaphore_status;
+ rtems_attribute attribute_set;
the_semaphore = _Semaphore_Get( id, &location );
switch ( location ) {
case OBJECTS_LOCAL:
- if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
+ attribute_set = the_semaphore->attribute_set;
+#if defined(RTEMS_SMP)
+ if ( _Attributes_Is_multiprocessor_resource_sharing( attribute_set ) ) {
+ MRSP_Status mrsp_status = _MRSP_Release(
+ &the_semaphore->Core_control.mrsp,
+ _Thread_Get_executing()
+ );
+ _Objects_Put( &the_semaphore->Object );
+ return _Semaphore_Translate_MRSP_status_code( mrsp_status );
+ } else
+#endif
+ if ( !_Attributes_Is_counting_semaphore( attribute_set ) ) {
mutex_status = _CORE_mutex_Surrender(
&the_semaphore->Core_control.mutex,
id,