4.104.114.84.95
Rev | Line | |
---|
[20de272] | 1 | /* Task_2 |
---|
| 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 | * |
---|
[60b791ad] | 11 | * COPYRIGHT (c) 1989-1998. |
---|
[20de272] | 12 | * On-Line Applications Research Corporation (OAR). |
---|
[03f2154e] | 13 | * Copyright assigned to U.S. Government, 1994. |
---|
[20de272] | 14 | * |
---|
[98e4ebf5] | 15 | * The license and distribution terms for this file may be |
---|
| 16 | * found in the file LICENSE in this distribution or at |
---|
[03f2154e] | 17 | * http://www.OARcorp.com/rtems/license.html. |
---|
[20de272] | 18 | * |
---|
| 19 | * $Id$ |
---|
| 20 | */ |
---|
| 21 | |
---|
| 22 | #include "system.h" |
---|
| 23 | #include <errno.h> |
---|
| 24 | |
---|
| 25 | void *Task_2( |
---|
| 26 | void *argument |
---|
| 27 | ) |
---|
| 28 | { |
---|
| 29 | int status; |
---|
| 30 | void *return_pointer; |
---|
| 31 | |
---|
| 32 | puts( "Task_2: join to Task_1" ); |
---|
| 33 | status = pthread_join( Task_id, &return_pointer ); |
---|
| 34 | puts( "Task_2: returned from pthread_join" ); |
---|
| 35 | if ( status ) |
---|
| 36 | printf( "status = %d\n", status ); |
---|
| 37 | assert( !status ); |
---|
| 38 | |
---|
| 39 | if ( return_pointer == &Task_id ) |
---|
| 40 | puts( "Task_2: pthread_join returned correct pointer" ); |
---|
| 41 | else |
---|
| 42 | printf( |
---|
| 43 | "Task_2: pthread_join returned incorrect pointer (%p != %p)\n", |
---|
| 44 | return_pointer, |
---|
| 45 | &Task_id |
---|
| 46 | ); |
---|
| 47 | |
---|
| 48 | puts( "*** END OF POSIX TEST 8 ***" ); |
---|
| 49 | exit( 0 ); |
---|
| 50 | |
---|
| 51 | return NULL; /* just so the compiler thinks we returned something */ |
---|
| 52 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.