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.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/cpukit/rtems/src/semrelease.c b/cpukit/rtems/src/semrelease.c
index 37a05b2507..5d41b6cfae 100644
--- a/cpukit/rtems/src/semrelease.c
+++ b/cpukit/rtems/src/semrelease.c
@@ -62,19 +62,26 @@ rtems_status_code rtems_semaphore_release(
CORE_mutex_Status mutex_status;
CORE_semaphore_Status semaphore_status;
rtems_attribute attribute_set;
+ ISR_lock_Context lock_context;
- the_semaphore = _Semaphore_Get( id, &location );
+ the_semaphore = _Semaphore_Get_interrupt_disable(
+ id,
+ &location,
+ &lock_context
+ );
switch ( location ) {
case OBJECTS_LOCAL:
attribute_set = the_semaphore->attribute_set;
#if defined(RTEMS_SMP)
if ( _Attributes_Is_multiprocessor_resource_sharing( attribute_set ) ) {
- MRSP_Status mrsp_status = _MRSP_Release(
+ MRSP_Status mrsp_status;
+
+ mrsp_status = _MRSP_Release(
&the_semaphore->Core_control.mrsp,
- _Thread_Get_executing()
+ _Thread_Executing,
+ &lock_context
);
- _Objects_Put( &the_semaphore->Object );
return _Semaphore_Translate_MRSP_status_code( mrsp_status );
} else
#endif
@@ -82,17 +89,17 @@ rtems_status_code rtems_semaphore_release(
mutex_status = _CORE_mutex_Surrender(
&the_semaphore->Core_control.mutex,
id,
- MUTEX_MP_SUPPORT
+ MUTEX_MP_SUPPORT,
+ &lock_context
);
- _Objects_Put( &the_semaphore->Object );
return _Semaphore_Translate_core_mutex_return_code( mutex_status );
} else {
semaphore_status = _CORE_semaphore_Surrender(
&the_semaphore->Core_control.semaphore,
id,
- MUTEX_MP_SUPPORT
+ MUTEX_MP_SUPPORT,
+ &lock_context
);
- _Objects_Put( &the_semaphore->Object );
return
_Semaphore_Translate_core_semaphore_return_code( semaphore_status );
}