Changeset 7d96321 in rtems for testsuites/psxtests/psx08/init.c


Ignore:
Timestamp:
Oct 4, 1999, 7:41:34 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
92b211a
Parents:
811804fe
Message:

Modifications necessary to support testing of exitting a pthread from
Charles-Antione Gauthier <charles.gauthier@…>.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/psx08/init.c

    r811804fe r7d96321  
    4545  /* create thread */
    4646 
    47   puts( "Init: creating two tasks" );
    48   status = pthread_create( &Task_id, NULL, Task_1, NULL );
    49   assert( !status );
    50  
    51   status = pthread_create( &Task2_id, NULL, Task_2, NULL );
     47  status = pthread_create( &Task1_id, NULL, Task_1, NULL );
    5248  assert( !status );
    5349 
     
    5753
    5854  puts( "Init: pthread_join - SUCCESSFUL" );
    59   status = pthread_join( Task_id, &return_pointer );
    60   /* assert is below comment */
     55  status = pthread_join( Task1_id, &return_pointer );
    6156
    62      /* switch to Task 1 */
    63 
    64   puts( "Init: returned from pthread_join" );
     57  puts( "Init: returned from pthread_join through return" );
    6558  if ( status )
    6659    printf( "status = %d\n", status );
    6760  assert( !status );
    6861
    69   if ( return_pointer == &Task_id )
     62  if ( return_pointer == &Task1_id )
    7063    puts( "Init: pthread_join returned correct pointer" );
    7164  else
     
    7366      "Init: pthread_join returned incorrect pointer (%p != %p)\n",
    7467      return_pointer,
    75       &Task_id
     68      &Task1_id
     69    );
     70 
     71  puts( "Init: creating two pthreads" );
     72  status = pthread_create( &Task2_id, NULL, Task_2, NULL );
     73  assert( !status );
     74 
     75  status = pthread_create( &Task3_id, NULL, Task_3, NULL );
     76  assert( !status );
     77 
     78  puts( "Init: pthread_join - SUCCESSFUL" );
     79  status = pthread_join( Task2_id, &return_pointer );
     80  /* assert is below comment */
     81
     82  puts( "Init: returned from pthread_join through pthread_exit" );
     83  if ( status )
     84    printf( "status = %d\n", status );
     85  assert( !status );
     86
     87  if ( return_pointer == &Task2_id )
     88    puts( "Init: pthread_join returned correct pointer" );
     89  else
     90    printf(
     91      "Init: pthread_join returned incorrect pointer (%p != %p)\n",
     92      return_pointer,
     93      &Task2_id
    7694    );
    7795 
    7896  puts( "Init: exitting" );
    79   pthread_exit( NULL );
    80 
    81   return NULL; /* just so the compiler thinks we returned something */
     97  return NULL;
    8298}
Note: See TracChangeset for help on using the changeset viewer.