When the core delivers a process-oriented signal, it selects one of the threads that does not block the signal. This means that it never selects any of the threads except the signal processing thread (which acts as if it is unlocked when it is locked in sigwaitinfo() or similar). In other words: the kernel knows where to give the signal, because you have packed such things that the signal processing stream is the only stream that has ever been allowed to deliver the signal.
In the signal handler, you are not using the pthreads API or any non-synchronous signaling functions. The above solution does not process signals in signal handlers - it processes signals in the normal flow of the signal processing stream after sigwaitinfo() returns. This allows it to access non-asynchronous signal functions, which is the whole.
caf Jun 03 2018-11-11T00: 00Z
source share