All pastes #585117 Raw Edit

Untitled

public cpp v1 · immutable
·published 2007-06-23 02:07 UTC
rendered paste body
#include <pthread.h>#include <stdlib.h>#include <stdio.h>void *thread_func( void *vptr_args );int i, j = 0;int main( void ){  char* answer[6] = {"To", "get", "to", "the", "other", "side"};   pthread_t threads[6];  for(j=0;j<6;) {        pthread_create( &threads[j], NULL, &thread_func, (void *) answer[j]);  }   for(i=0;i<6;i++) {    pthread_join( threads[i], NULL );  }  exit( EXIT_SUCCESS );}void *thread_func( void *vptr_args ){    fprintf( stderr,(char*) vptr_args );  fprintf( stderr, " ");  j++;       pthread_exit( NULL );}