source: rtems/c/src/tests/psxtests/psx06/task2.c @ 51f5d64c

4.104.114.84.95
Last change on this file since 51f5d64c was 51f5d64c, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 2, 1997 at 4:26:39 PM

corrected printf format to avoid warning

  • Property mode set to 100644
File size: 1.3 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, 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
24void *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 );
40  printf( "Task_2: Got the key value of %ld\n",
41          (rtems_unsigned32 *)key_data - Data_array );
42  if ( status )
43    printf( "status = %d\n", status );
44  assert( !status );
45 
46  puts( "Task2: exitting" );
47  pthread_exit( NULL );
48 
49     /* switch to init task */
50 
51  return NULL; /* just so the compiler thinks we returned something */
52}
Note: See TracBrowser for help on using the repository browser.