//他们分别有什么区别?pthread_exit(0);
....
int main(void)
{
pthread_t tid1,tid2;
printf("hello, condition variable test\n");
pthread_mutex_init(&mutex,NULL);
pthread_cond_init(&cond,NULL);
pthread_create(&tid1,NULL,child1,NULL);
pthread_create(&tid2,NULL,child2,NULL);
do
{
sleep(2); /* comment 4 */
pthread_cancel(tid1); /* comment 5 */
sleep(2); /* comment 6 */
pthread_cond_signal(&cond);
}while(1);
sleep(100);
//下面这句,
//有些程序中写成pthread_exit(0);
//也有写成exit(0);
//也有写成return;
//他们分别有什么区别?
pthread_exit(0);
}