原帖由 jemy.zhang 于 2007-3-2 12:46 发表
我是这样做的,
fork进程以后,记住子进程的进程号pid,然后kill(pid,9);就可以了。
或者通过管道向子进程发送自杀信号,子进程在循环中检测信号,一旦检测到主进程要求子进程“自杀”,那么子进程就可以exit了 ...
原帖由 caijimin 于 2007-3-2 09:36 发表
看看下面这段,是否有帮助。
Never terminate the thread from outside the thread. Always terminate the thread from within the thread itself. If the thread isn't allowed to terminate itself, it will ...
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |