RTEMS
msgqflush.c
Go to the documentation of this file.
1 
9 /*
10  * COPYRIGHT (c) 1989-2014.
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.org/license/LICENSE.
16  */
17 
18 #ifdef HAVE_CONFIG_H
19 #include "config.h"
20 #endif
21 
23 
25  rtems_id id,
26  uint32_t *count
27 )
28 {
29  Message_queue_Control *the_message_queue;
30  Thread_queue_Context queue_context;
31 
32  if ( count == NULL ) {
33  return RTEMS_INVALID_ADDRESS;
34  }
35 
36  the_message_queue = _Message_queue_Get( id, &queue_context );
37 
38  if ( the_message_queue == NULL ) {
39 #if defined(RTEMS_MULTIPROCESSING)
40  return _Message_queue_MP_Flush( id, count );
41 #else
42  return RTEMS_INVALID_ID;
43 #endif
44  }
45 
47  &the_message_queue->message_queue,
48  &queue_context
49  );
50  return RTEMS_SUCCESSFUL;
51 }
Thread queue context for the thread queue methods.
Definition: threadq.h:198
Classic Message Queue Manager Implementation.
rtems_status_code rtems_message_queue_flush(rtems_id id, uint32_t *count)
%
Definition: msgqflush.c:24
uint32_t _CORE_message_queue_Flush(CORE_message_queue_Control *the_message_queue, Thread_queue_Context *queue_context)
Flushes pending messages.
Definition: coremsgflush.c:24
This status code indicates successful completion.
Definition: status.h:86
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:82
CORE_message_queue_Control message_queue
Definition: messagedata.h:42
This status code indicates that a specified address was invalid.
Definition: status.h:133
This status code indicates that an object identifier was invalid.
Definition: status.h:106
Objects_Id rtems_id
Values of this type identify an RTEMS object.
Definition: types.h:99