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/task2.c

    r811804fe r7d96321  
    2828{
    2929  int   status;
    30   void  *return_pointer;
    3130
    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 )
     31  puts( "Task_2: sleep 1 second" );
     32
     33  sleep( 1 );
     34
     35  /* switch to task 3 */
     36
     37  puts( "Task_2: join to detached task (Init) -- EINVAL" );
     38  status = pthread_join( Init_id, NULL );
     39  if ( status != EINVAL )
    3640    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     );
     41  assert( status == EINVAL );
     42 
     43  puts( "Task_2: join to self task (Init) -- EDEADLK" );
     44  status = pthread_join( pthread_self(), NULL );
     45  if ( status != EDEADLK )
     46    printf( "status = %d\n", status );
     47  assert( status == EDEADLK );
    4748
    48   puts( "*** END OF POSIX TEST 8 ***" );
    49   exit( 0 );
     49  puts( "Task_2: exitting" );
     50
     51  pthread_exit( &Task2_id );
     52
     53     /* switch to init task */
    5054
    5155  return NULL; /* just so the compiler thinks we returned something */
Note: See TracChangeset for help on using the changeset viewer.