summaryrefslogtreecommitdiffstats
path: root/c/src/exec/score/src/coremsgclose.c
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>2000-01-13 18:32:38 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>2000-01-13 18:32:38 +0000
commit9c1c778d56ef42f8f00dbd87b2bcf2293bf49380 (patch)
treec1083944eec6f81812a515ca8332433ea3828499 /c/src/exec/score/src/coremsgclose.c
parent+ Added and yellow line tested _CORE_message_queue_Flush_waiting_threads (diff)
downloadrtems-9c1c778d56ef42f8f00dbd87b2bcf2293bf49380.tar.bz2
+ Added comments
Diffstat (limited to 'c/src/exec/score/src/coremsgclose.c')
-rw-r--r--c/src/exec/score/src/coremsgclose.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/c/src/exec/score/src/coremsgclose.c b/c/src/exec/score/src/coremsgclose.c
index 552c0dc477..245c18524f 100644
--- a/c/src/exec/score/src/coremsgclose.c
+++ b/c/src/exec/score/src/coremsgclose.c
@@ -50,15 +50,26 @@ void _CORE_message_queue_Close(
unsigned32 status
)
{
+
+ /*
+ * This will flush blocked threads whether they were blocked on
+ * a send or receive.
+ */
+
+ _Thread_queue_Flush(
+ &the_message_queue->Wait_queue,
+ remote_extract_callout,
+ status
+ );
+
+ /*
+ * 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.
+ */
if ( the_message_queue->number_of_pending_messages != 0 )
(void) _CORE_message_queue_Flush_support( the_message_queue );
- else
- _Thread_queue_Flush(
- &the_message_queue->Wait_queue,
- remote_extract_callout,
- status
- );
(void) _Workspace_Free( the_message_queue->message_buffers );