5
Last change
on this file since 93306058 was
0e1d11f3,
checked in by Sebastian Huber <sebastian.huber@…>, on 05/27/16 at 11:26:53
|
score: Add _Thread_queue_Context_set_MP_callout()
Add _Thread_queue_Context_set_MP_callout() to simplify
_Thread_queue_Context_initialize(). This makes it possible to more
easily add additional fields to Thread_queue_Context.
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief rtems_message_queue_flush |
---|
5 | * @ingroup ClassicMessageQueue Message Queues |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-2014. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #if HAVE_CONFIG_H |
---|
18 | #include "config.h" |
---|
19 | #endif |
---|
20 | |
---|
21 | #include <rtems/rtems/messageimpl.h> |
---|
22 | |
---|
23 | rtems_status_code rtems_message_queue_flush( |
---|
24 | rtems_id id, |
---|
25 | uint32_t *count |
---|
26 | ) |
---|
27 | { |
---|
28 | Message_queue_Control *the_message_queue; |
---|
29 | Thread_queue_Context queue_context; |
---|
30 | |
---|
31 | if ( count == NULL ) { |
---|
32 | return RTEMS_INVALID_ADDRESS; |
---|
33 | } |
---|
34 | |
---|
35 | the_message_queue = _Message_queue_Get( id, &queue_context ); |
---|
36 | |
---|
37 | if ( the_message_queue == NULL ) { |
---|
38 | #if defined(RTEMS_MULTIPROCESSING) |
---|
39 | return _Message_queue_MP_Flush( id, count ); |
---|
40 | #else |
---|
41 | return RTEMS_INVALID_ID; |
---|
42 | #endif |
---|
43 | } |
---|
44 | |
---|
45 | *count = _CORE_message_queue_Flush( |
---|
46 | &the_message_queue->message_queue, |
---|
47 | &queue_context |
---|
48 | ); |
---|
49 | return RTEMS_SUCCESSFUL; |
---|
50 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.