码迷,mamicode.com
首页 > 其他好文 > 详细

pthread_detach(pthread_self())

时间:2016-03-04 16:10:40      阅读:120      评论:0      收藏:0      [点我收藏+]

标签:

pthread_detach(pthread_self())

将状态改为unjoinable状态,确保资源的释放。其实简单的说就是在线程函数头加上 pthread_detach(pthread_self())的话,线程状态改变,在函数尾部直接 pthread_exit线程就会自动退出。省去了给线程擦屁股的麻烦

 

pthread_detach(pthread_self())

标签:

原文地址:http://www.cnblogs.com/mylinux/p/5242291.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!