Pthreads中的信号处理

2 c signals pthreads

提及的man页面pthreads:

 POSIX.1 also requires that threads share a range  of  other  attributes
       (i.e., these attributes are process-wide rather than per-thread):

       ...

       -  signal dispositions

       ...
Run Code Online (Sandbox Code Playgroud)

"信号处置"是什么意思?

Eri*_*ers 6

信号处理是信号传递过程中的一个动作.每个信号都有一个配置.有默认值.

信号(7):

Signal Dispositions
    Each signal has a current disposition, which determines how the process
    behaves when it is delivered the signal.

[Dispositions are:]
    Term   Default action is to terminate the process.

    Ign    Default action is to ignore the signal.

    Core   Default action is to terminate the process and dump core (see core(5)).

    Stop   Default action is to stop the process.

    Cont   Default action is to continue the process if it is currently stopped.
[...]
    The signal disposition is a per-process attribute: in a multithreaded
    application, the disposition of a particular signal is the same for all
    threads.