source: rtems/cpukit/score/src/coremsgclose.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 2.0 KB
Line 
1/*
2 *  CORE Message Queue Handler
3 *
4 *  DESCRIPTION:
5 *
6 *  This package is the implementation of the CORE Message Queue Handler.
7 *  This core object provides task synchronization and communication functions
8 *  via messages passed to queue objects.
9 *
10 *  COPYRIGHT (c) 1989-1999.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.com/license/LICENSE.
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/system.h>
23#include <rtems/score/chain.h>
24#include <rtems/score/isr.h>
25#include <rtems/score/object.h>
26#include <rtems/score/coremsg.h>
27#include <rtems/score/states.h>
28#include <rtems/score/thread.h>
29#include <rtems/score/wkspace.h>
30
31/*
32 *  _CORE_message_queue_Close
33 *
34 *  This function closes a message by returning all allocated space and
35 *  flushing the message_queue's task wait queue.
36 *
37 *  Input parameters:
38 *    the_message_queue      - the message_queue to be flushed
39 *    remote_extract_callout - function to invoke remotely
40 *    status                 - status to pass to thread
41 *
42 *  Output parameters:  NONE
43 */
44
45void _CORE_message_queue_Close(
46  CORE_message_queue_Control *the_message_queue,
47  Thread_queue_Flush_callout  remote_extract_callout,
48  uint32_t                    status
49)
50{
51
52  /*
53   *  This will flush blocked threads whether they were blocked on
54   *  a send or receive.
55   */
56
57  _Thread_queue_Flush(
58    &the_message_queue->Wait_queue,
59    remote_extract_callout,
60    status
61  );
62
63  /*
64   *  This removes all messages from the pending message queue.  Since
65   *  we just flushed all waiting threads, we don't have to worry about
66   *  the flush satisfying any blocked senders as a side-effect.
67   */
68
69  if ( the_message_queue->number_of_pending_messages != 0 )
70    (void) _CORE_message_queue_Flush_support( the_message_queue );
71
72  (void) _Workspace_Free( the_message_queue->message_buffers );
73
74}
Note: See TracBrowser for help on using the repository browser.