source: rtems/testsuites/sptests/sppartition_err01/task3.c @ 255178e

4.115
Last change on this file since 255178e was 255178e, checked in by Mandar Juvekar <mjuvekar0@…>, on 01/02/14 at 19:22:36

sptests: Refactor sp09 into sppartition_err01 and sp09.

  • 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.com/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.