summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/semdelete.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-23 11:40:18 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-25 12:43:54 +0200
commit631b3c8967a329cdd53e54365e4e4c0aa93a4251 (patch)
tree3a750b145a90c90aa86222c26ee68aeb8c87a417 /cpukit/rtems/src/semdelete.c
parentscore: Get rid of mp_id parameter (diff)
downloadrtems-631b3c8967a329cdd53e54365e4e4c0aa93a4251.tar.bz2
score: Move thread queue MP callout to context
Drop the multiprocessing (MP) dependent callout parameter from the thread queue extract, dequeue, flush and unblock methods. Merge this parameter with the lock context into new structure Thread_queue_Context. This helps to gets rid of the conditionally compiled method call helpers.
Diffstat (limited to 'cpukit/rtems/src/semdelete.c')
-rw-r--r--cpukit/rtems/src/semdelete.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/cpukit/rtems/src/semdelete.c b/cpukit/rtems/src/semdelete.c
index cf2283830c..023a57cf23 100644
--- a/cpukit/rtems/src/semdelete.c
+++ b/cpukit/rtems/src/semdelete.c
@@ -25,12 +25,16 @@ rtems_status_code rtems_semaphore_delete(
rtems_id id
)
{
- Semaphore_Control *the_semaphore;
- ISR_lock_Context lock_context;
- rtems_attribute attribute_set;
+ Semaphore_Control *the_semaphore;
+ Thread_queue_Context queue_context;
+ rtems_attribute attribute_set;
_Objects_Allocator_lock();
- the_semaphore = _Semaphore_Get( id, &lock_context );
+ the_semaphore = _Semaphore_Get(
+ id,
+ &queue_context,
+ _Semaphore_MP_Send_object_was_deleted
+ );
if ( the_semaphore == NULL ) {
_Objects_Allocator_unlock();
@@ -52,13 +56,13 @@ rtems_status_code rtems_semaphore_delete(
_MRSP_Acquire_critical(
&the_semaphore->Core_control.mrsp,
- &lock_context
+ &queue_context
);
mrsp_status = _MRSP_Can_destroy( &the_semaphore->Core_control.mrsp );
if ( mrsp_status != MRSP_SUCCESSFUL ) {
_MRSP_Release(
&the_semaphore->Core_control.mrsp,
- &lock_context
+ &queue_context
);
_Objects_Allocator_unlock();
return _Semaphore_Translate_MRSP_status_code( mrsp_status );
@@ -68,7 +72,7 @@ rtems_status_code rtems_semaphore_delete(
if ( !_Attributes_Is_counting_semaphore( attribute_set ) ) {
_CORE_mutex_Acquire_critical(
&the_semaphore->Core_control.mutex,
- &lock_context
+ &queue_context
);
if (
@@ -77,7 +81,7 @@ rtems_status_code rtems_semaphore_delete(
) {
_CORE_mutex_Release(
&the_semaphore->Core_control.mutex,
- &lock_context
+ &queue_context
);
_Objects_Allocator_unlock();
return RTEMS_RESOURCE_IN_USE;
@@ -85,7 +89,7 @@ rtems_status_code rtems_semaphore_delete(
} else {
_CORE_semaphore_Acquire_critical(
&the_semaphore->Core_control.semaphore,
- &lock_context
+ &queue_context
);
}
@@ -93,22 +97,20 @@ rtems_status_code rtems_semaphore_delete(
#if defined(RTEMS_SMP)
if ( _Attributes_Is_multiprocessor_resource_sharing( attribute_set ) ) {
- _MRSP_Destroy( &the_semaphore->Core_control.mrsp, &lock_context );
+ _MRSP_Destroy( &the_semaphore->Core_control.mrsp, &queue_context );
} else
#endif
if ( !_Attributes_Is_counting_semaphore( attribute_set ) ) {
_CORE_mutex_Flush(
&the_semaphore->Core_control.mutex,
_CORE_mutex_Was_deleted,
- _Semaphore_MP_Send_object_was_deleted,
- &lock_context
+ &queue_context
);
_CORE_mutex_Destroy( &the_semaphore->Core_control.mutex );
} else {
_CORE_semaphore_Destroy(
&the_semaphore->Core_control.semaphore,
- _Semaphore_MP_Send_object_was_deleted,
- &lock_context
+ &queue_context
);
}