From 631b3c8967a329cdd53e54365e4e4c0aa93a4251 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 23 May 2016 11:40:18 +0200 Subject: 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. --- cpukit/rtems/src/semdelete.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'cpukit/rtems/src/semdelete.c') 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 ); } -- cgit v1.2.3