i*****f 发帖数: 578 | 1 【 以下文字转载自 Linux 讨论区 】
发信人: icewolf (好好活), 信区: Linux
标 题: 关于signal handler
发信站: BBS 未名空间站 (Mon Dec 21 18:22:17 2009, 美东)
最近在看gnu libc的manual,里面讲到signal handler的时候有这个例子(chapter 24
.4.2, http://www.gnu.org/software/libc/manual/html_node/Termination-in-Handler.html#Termination-in-Handler):
1 volatile sig_atomic_t fatal_error_in_progress = 0;
2
3 void
4 fatal_error_signal (int sig)
5 {
6 /* Since this handler is established for more than one kind of signal,
7 it might still get invoked recurs | m*****e 发帖数: 4193 | 2 It means while you are handling the signal, another signal of different type
could raise, and you should not handle it.
24
【在 i*****f 的大作中提到】 : 【 以下文字转载自 Linux 讨论区 】 : 发信人: icewolf (好好活), 信区: Linux : 标 题: 关于signal handler : 发信站: BBS 未名空间站 (Mon Dec 21 18:22:17 2009, 美东) : 最近在看gnu libc的manual,里面讲到signal handler的时候有这个例子(chapter 24 : .4.2, http://www.gnu.org/software/libc/manual/html_node/Termination-in-Handler.html#Termination-in-Handler): : 1 volatile sig_atomic_t fatal_error_in_progress = 0; : 2 : 3 void : 4 fatal_error_signal (int sig)
| i*****f 发帖数: 578 | 3 Thanks for help!
what is line 9 trying to judge? If fatal_err_in_prog is set, does that mean
another instance of this handler has been invoked for another signal? If
this is the case, why doesn't this handler simply return in this case?
Why does it raise the signal again?
type
【在 m*****e 的大作中提到】 : It means while you are handling the signal, another signal of different type : could raise, and you should not handle it. : : 24
|
|