> Code:
> printf("new loop...\n");pthread_detach does not take a pointer of pthread_t, just pthread_t.
> pthread_create(&t1, NULL, thread, (void*)1);
> res = pthread_detach(&t1);
> printf("Detach thread 1 (%d)\n", res);
> pthread_create(&t2, NULL, thread, (void*)2);
> res = pthread_detach(&t2);