#include #include void *thr_main(void *arg); int value; int main(int argc, char *argv[]){ pthread_t thrID[3]; int i; value = 1; for(i=0; i<3; i++) pthread_create(&(thrID[i]), NULL, thr_main, NULL); for(i=0; i<3; i++) pthread_join(thrID[i], NULL); printf("value: %d\n",value); return(0); } void *thr_main(void *arg){ value++; }