#include #include #include #include #include #include void *thread(void *ptr) { int id = *(int *) ptr; printf("thread %d\n", id); while(1) ; } int main(int argc, const char *argv[]) { pthread_t thread1, thread2; int t1 = 1; int t2 = 2; pthread_create(&thread1, NULL, *thread, &t1); pthread_create(&thread2, NULL, *thread, &t2); pthread_join(thread1, NULL); pthread_join(thread1, NULL); while (1) ; }