编程爱好者

编程爱好者

 

linux检测线程是否死掉了

int pthread_kill
(
   pthread_t thread,
   int sig
);

thread 是检查线程的id,sig是0
如果线程存活,函数将返回0.如果线程死了或者不存在,返回ESRCH .因为线程的id会被重新使用,所以这种检测也是不太可靠.

posted on 2008-08-15 20:13  new_man  阅读(1705)  评论(0编辑  收藏  举报

导航