source: rtems/testsuites/sptests/spmsgq_err02/task3.c @ d4edbdbc

4.115
Last change on this file since d4edbdbc was d4edbdbc, checked in by Sebastian Huber <sebastian.huber@…>, on 03/20/15 at 13:09:26

Replace www.rtems.com with www.rtems.org

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*  Task_3
2 *
3 *  This routine serves as a test task.  Its only purpose in life is to
4 *  generate the error where a message queue is deleted while a task
5 *  is waiting there for a message.
6 *
7 *  Input parameters:
8 *    argument - task argument
9 *
10 *  Output parameters:  NONE
11 *
12 *  COPYRIGHT (c) 1989-2007.
13 *  On-Line Applications Research Corporation (OAR).
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.rtems.org/license/LICENSE.
18 */
19
20#ifdef HAVE_CONFIG_H
21#include "config.h"
22#endif
23
24#include "system.h"
25
26rtems_task Task_3(
27  rtems_task_argument argument
28)
29{
30  rtems_status_code status;
31  long              buffer[ 4 ];
32  size_t            size;
33
34  puts( "TA3 - rtems_message_queue_receive - Q 1 - RTEMS_WAIT FOREVER" );
35  status = rtems_message_queue_receive(
36    Queue_id[ 1 ],
37    (long (*)[4])buffer,
38    &size,
39    RTEMS_DEFAULT_OPTIONS,
40    RTEMS_NO_TIMEOUT
41  );
42  fatal_directive_status(
43    status,
44    RTEMS_OBJECT_WAS_DELETED,
45    "rtems_message_queue_receive waiting to be deleted"
46  );
47  puts(
48    "TA3 - rtems_message_queue_receive - woke up with RTEMS_OBJECT_WAS_DELETED"
49  );
50
51  puts( "TA3 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL" );
52  status = rtems_task_delete( RTEMS_SELF );
53  directive_failed( status, "rtems_task_delete of TA3" );
54}
Note: See TracBrowser for help on using the repository browser.