RTEMS
cpukit
rtems
src
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
22
#include <
rtems/rtems/messageimpl.h
>
23
24
rtems_status_code
rtems_message_queue_flush
(
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
46
*count =
_CORE_message_queue_Flush
(
47
&the_message_queue->
message_queue
,
48
&queue_context
49
);
50
return
RTEMS_SUCCESSFUL
;
51
}
Thread_queue_Context
Thread queue context for the thread queue methods.
Definition:
threadq.h:198
messageimpl.h
Classic Message Queue Manager Implementation.
rtems_message_queue_flush
rtems_status_code rtems_message_queue_flush(rtems_id id, uint32_t *count)
%
Definition:
msgqflush.c:24
_CORE_message_queue_Flush
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
Message_queue_Control
Definition:
messagedata.h:38
RTEMS_SUCCESSFUL
This status code indicates successful completion.
Definition:
status.h:86
rtems_status_code
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition:
status.h:82
Message_queue_Control::message_queue
CORE_message_queue_Control message_queue
Definition:
messagedata.h:42
RTEMS_INVALID_ADDRESS
This status code indicates that a specified address was invalid.
Definition:
status.h:133
RTEMS_INVALID_ID
This status code indicates that an object identifier was invalid.
Definition:
status.h:106
rtems_id
Objects_Id rtems_id
Values of this type identify an RTEMS object.
Definition:
types.h:99
Generated by
1.8.14