9 static void *threadmain( void *dummy
)
11 sleep( (unsigned long)dummy
);
15 int main( int argc
, char **argv
)
19 pthread_t childthread
;
23 pthread_create( &childthread
, NULL
, threadmain
, (void *)2 );
28 pthread_create( &childthread
, NULL
, threadmain
, 0 );
29 pthread_join( childthread
, &res
);
33 perror( "FAILED: fork failed\n" );
39 pthread_join( childthread
, &res
);
41 while(waitpid(childpid
, &status
, 0) != childpid
) {
45 printf("FAILED - timeout waiting for child\n");