摘要: 1.相关函数介绍 a. int pthread_cancel(pthread_t thread) 发送终止信号给thread线程,如果成功则返回0,否则为非0值。发送成功并不意味着thread会终止。 b. int pthread_setcancelstate(int state, int *old 阅读全文
posted @ 2019-02-22 18:11 流水灯 阅读(795) 评论(0) 推荐(0) 编辑
摘要: linux内核会发射一些信号,应用程序可以捕捉信号执行指定函数 int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); 成功:0;失败:-1,设置errno act:传入参数,新的处理方式。o 阅读全文
posted @ 2019-02-22 16:29 流水灯 阅读(440) 评论(0) 推荐(0) 编辑