1 | /* Task_1 |
---|
2 | * |
---|
3 | * This task initializes the signal catcher, sends the first signal |
---|
4 | * if running on the first node, and loops while waiting for signals. |
---|
5 | * |
---|
6 | * NOTE: The signal catcher is not reentrant and hence RTEMS_NO_ASR must |
---|
7 | * be a part of its execution mode. |
---|
8 | * |
---|
9 | * Input parameters: |
---|
10 | * argument - task argument |
---|
11 | * |
---|
12 | * Output parameters: NONE |
---|
13 | * |
---|
14 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
15 | * On-Line Applications Research Corporation (OAR). |
---|
16 | * All rights assigned to U.S. Government, 1994. |
---|
17 | * |
---|
18 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
19 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
20 | * notice must appear in all copies of this file and its derivatives. |
---|
21 | * |
---|
22 | * $Id$ |
---|
23 | */ |
---|
24 | |
---|
25 | #include "system.h" |
---|
26 | |
---|
27 | rtems_task Task_1( |
---|
28 | rtems_task_argument argument |
---|
29 | ) |
---|
30 | { |
---|
31 | rtems_status_code status; |
---|
32 | |
---|
33 | puts( "TA1 - rtems_signal_catch: initializing signal catcher" ); |
---|
34 | status = rtems_signal_catch( Process_asr, RTEMS_NO_ASR | RTEMS_NO_PREEMPT ); |
---|
35 | directive_failed( status, "rtems_signal_catch" ); |
---|
36 | |
---|
37 | puts( "TA1 - Sending signal to self" ); |
---|
38 | status = rtems_signal_send( Task_id[ 1 ], RTEMS_SIGNAL_16 ); |
---|
39 | directive_failed( status, "rtems_signal_send" ); |
---|
40 | |
---|
41 | if ( Task_2_preempted == TRUE ) |
---|
42 | puts( "TA1 - TA2 correctly preempted me" ); |
---|
43 | |
---|
44 | puts("TA1 - Got Back!!!"); |
---|
45 | |
---|
46 | puts( "*** END OF TEST 17 ***" ); |
---|
47 | exit( 0 ); |
---|
48 | } |
---|