
(void*) thread2
pthread_t id2
main(){
ret=pthread_create(&id,NULL,(void*) thread,NULL)
if (ret!=0)
{
printf("Create pthread error!\n")
exit (1)
}
//第二个线程
ret=pthread_create(&id2,NULL,(void*) thread2,NULL)
if (ret!=0)
{
printf("Create pthread2 error!\n")
exit (1)
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)