[c65a0cee] | 1 | /* Task_2 |
---|
| 2 | * |
---|
| 3 | * This routine serves as a test task. |
---|
| 4 | * |
---|
| 5 | * Input parameters: |
---|
| 6 | * argument - task argument |
---|
| 7 | * |
---|
| 8 | * Output parameters: NONE |
---|
| 9 | * |
---|
| 10 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
| 11 | * On-Line Applications Research Corporation (OAR). |
---|
| 12 | * All rights assigned to U.S. Government, 1994. |
---|
| 13 | * |
---|
| 14 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
| 15 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
| 16 | * notice must appear in all copies of this file and its derivatives. |
---|
| 17 | * |
---|
| 18 | * $Id$ |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | #include "system.h" |
---|
| 22 | #include <errno.h> |
---|
| 23 | |
---|
| 24 | void *Task_2( |
---|
| 25 | void *argument |
---|
| 26 | ) |
---|
| 27 | { |
---|
| 28 | int status; |
---|
| 29 | rtems_unsigned32 *key_data; |
---|
| 30 | |
---|
| 31 | printf( "Destructor invoked %d times\n", Destructor_invoked ); |
---|
| 32 | |
---|
| 33 | printf( "Task_2: Setting the key to %d\n", 2 ); |
---|
| 34 | status = pthread_setspecific( Key_id, &Data_array[ 2 ] ); |
---|
| 35 | if ( status ) |
---|
| 36 | printf( "status = %d\n", status ); |
---|
| 37 | assert( !status ); |
---|
| 38 | |
---|
| 39 | key_data = pthread_getspecific( Key_id ); |
---|
[51f5d64c] | 40 | printf( "Task_2: Got the key value of %ld\n", |
---|
[c65a0cee] | 41 | (rtems_unsigned32 *)key_data - Data_array ); |
---|
| 42 | if ( status ) |
---|
| 43 | printf( "status = %d\n", status ); |
---|
| 44 | assert( !status ); |
---|
| 45 | |
---|
[5b08e20] | 46 | puts( "Task2: exitting" ); |
---|
[c65a0cee] | 47 | pthread_exit( NULL ); |
---|
| 48 | |
---|
| 49 | /* switch to init task */ |
---|
| 50 | |
---|
| 51 | return NULL; /* just so the compiler thinks we returned something */ |
---|
| 52 | } |
---|