[PATCH 02/20] score: Simplify _CORE_message_queue_Do_close()

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Apr 19 13:12:30 UTC 2016


Remove superfluous _CORE_message_queue_Flush() since we completely
re-initialize the structure in _CORE_message_queue_Initialize().
---
 cpukit/score/src/coremsgclose.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/cpukit/score/src/coremsgclose.c b/cpukit/score/src/coremsgclose.c
index fd026ad..e070d98 100644
--- a/cpukit/score/src/coremsgclose.c
+++ b/cpukit/score/src/coremsgclose.c
@@ -31,8 +31,6 @@ void _CORE_message_queue_Do_close(
 #endif
 )
 {
-  ISR_lock_Context lock_context;
-
   /*
    *  This will flush blocked threads whether they were blocked on
    *  a send or receive.
@@ -46,15 +44,6 @@ void _CORE_message_queue_Do_close(
     mp_id
   );
 
-  /*
-   *  This removes all messages from the pending message queue.  Since
-   *  we just flushed all waiting threads, we don't have to worry about
-   *  the flush satisfying any blocked senders as a side-effect.
-   */
-
-  _ISR_lock_ISR_disable( &lock_context );
-  (void) _CORE_message_queue_Flush( the_message_queue, &lock_context );
-
   (void) _Workspace_Free( the_message_queue->message_buffers );
 
   _Thread_queue_Destroy( &the_message_queue->Wait_queue );
-- 
1.8.4.5




More information about the devel mailing list