source: rtems/testsuites/mptests/mp10/task1.c @ bb3484c9

5
Last change on this file since bb3484c9 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*  Test_task1
2 *
3 *  This task attempts to receive a message from a global message queue.
4 *  It should never actually receive the message.
5 *
6 *  Input parameters:
7 *    argument - task argument
8 *
9 *  Output parameters:  NONE
10 *
11 *  COPYRIGHT (c) 1989-1999.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifdef HAVE_CONFIG_H
20#include "config.h"
21#endif
22
23#include "system.h"
24
25rtems_task Test_task1(
26  rtems_task_argument argument
27)
28{
29  char              receive_buffer[16];
30  size_t            size;
31  rtems_status_code status;
32
33  puts( "Getting QID of message queue" );
34
35  do {
36    status = rtems_message_queue_ident(
37      Queue_name[ 1 ],
38      RTEMS_SEARCH_ALL_NODES,
39      &Queue_id[ 1 ]
40    );
41  } while ( !rtems_is_status_successful( status ) );
42
43  puts( "Attempting to receive message ..." );
44  status = rtems_message_queue_receive(
45    Queue_id[ 1 ],
46    receive_buffer,
47    &size,
48    RTEMS_DEFAULT_OPTIONS,
49    RTEMS_NO_TIMEOUT
50  );
51  directive_failed( status, "rtems_message_queue_receive" );
52
53}
Note: See TracBrowser for help on using the repository browser.