4.115
Line | |
---|
1 | /* Task_3 |
---|
2 | * |
---|
3 | * This routine serves as a test task. It verifies the basic task |
---|
4 | * switching capabilities of the executive. |
---|
5 | * |
---|
6 | * Input parameters: |
---|
7 | * argument - task argument |
---|
8 | * |
---|
9 | * Output parameters: NONE |
---|
10 | * |
---|
11 | * COPYRIGHT (c) 1989-2009. |
---|
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 | #include <errno.h> |
---|
25 | |
---|
26 | void *Task_3( |
---|
27 | void *argument |
---|
28 | ) |
---|
29 | { |
---|
30 | int status; |
---|
31 | void *return_pointer; |
---|
32 | |
---|
33 | puts( "Task_3: join to Task_2" ); |
---|
34 | status = pthread_join( Task2_id, &return_pointer ); |
---|
35 | puts( "Task_3: returned from pthread_join" ); |
---|
36 | if ( status ) |
---|
37 | printf( "status = %d\n", status ); |
---|
38 | rtems_test_assert( !status ); |
---|
39 | |
---|
40 | if ( return_pointer == &Task2_id ) |
---|
41 | puts( "Task_3: pthread_join returned correct pointer" ); |
---|
42 | else |
---|
43 | printf( |
---|
44 | "Task_3: pthread_join returned incorrect pointer (%p != %p)\n", |
---|
45 | return_pointer, |
---|
46 | &Task2_id |
---|
47 | ); |
---|
48 | |
---|
49 | TEST_END(); |
---|
50 | rtems_test_exit( 0 ); |
---|
51 | |
---|
52 | return NULL; /* just so the compiler thinks we returned something */ |
---|
53 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.