我可以使用pthread_kill停止(暂停)pthread执行吗 [英] Can I stop(pause) pthread execution using pthread_kill

查看:371
本文介绍了我可以使用pthread_kill停止(暂停)pthread执行吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我发送SIGTSTP信号,线程会停止吗?或者换句话说,它的行为就像在SIGTSTP和SIGCONT上的过程一样?

Will a thread stop if I send it SIGTSTP signal? Or in other words will it behave like process on SIGTSTP and SIGCONT?

谢谢.

推荐答案

来自`man 3p pthread_kill:

From `man 3p pthread_kill:

请注意,pthread_kill()仅使信号在给定线程的上下文中进行处理. 信号作用(终止或停止)会影响过程,因为 整个.

Note that pthread_kill() only causes the signal to be handled in the context of the given thread; the signal action (termination or stopping) affects the process as a whole.

所以我想说您将停止整个过程,而不仅仅是线程.

So I'd say that you will stop the whole process, not just the thread.

这篇关于我可以使用pthread_kill停止(暂停)pthread执行吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆