5
Last change
on this file since 9a4eca5 was
c499856,
checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47
|
Change all references of rtems.com to rtems.org.
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Line | |
---|
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-2009. |
---|
11 | * On-Line Applications Research Corporation (OAR). |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.org/license/LICENSE. |
---|
16 | */ |
---|
17 | |
---|
18 | #ifdef HAVE_CONFIG_H |
---|
19 | #include "config.h" |
---|
20 | #endif |
---|
21 | |
---|
22 | #include "system.h" |
---|
23 | #include <errno.h> |
---|
24 | |
---|
25 | void *Task_2( |
---|
26 | void *argument |
---|
27 | ) |
---|
28 | { |
---|
29 | int status; |
---|
30 | uint32_t *key_data; |
---|
31 | |
---|
32 | printf( "Destructor invoked %d times\n", Destructor_invoked ); |
---|
33 | |
---|
34 | printf( "Task_2: Setting the key to %d\n", 2 ); |
---|
35 | status = pthread_setspecific( Key_id, &Data_array[ 2 ] ); |
---|
36 | if ( status ) |
---|
37 | printf( "status = %d\n", status ); |
---|
38 | rtems_test_assert( !status ); |
---|
39 | |
---|
40 | key_data = pthread_getspecific( Key_id ); |
---|
41 | printf( "Task_2: Got the key value of %ld\n", |
---|
42 | (unsigned long) ((uint32_t *)key_data - Data_array) ); |
---|
43 | if ( status ) |
---|
44 | printf( "status = %d\n", status ); |
---|
45 | rtems_test_assert( !status ); |
---|
46 | |
---|
47 | puts( "Task2: exitting" ); |
---|
48 | pthread_exit( NULL ); |
---|
49 | |
---|
50 | /* switch to init task */ |
---|
51 | |
---|
52 | return NULL; /* just so the compiler thinks we returned something */ |
---|
53 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.