guicho271828/trivial-signal

SIGNAL-HANDLER-BIND: other threads receiving signals?

Closed this issue · 1 comments

The README states

establish handlers dynamically by signal-handler-bind. The scope of this kind of signal handlers are thread-local.

but how does that work in practice? The unix signal semantics allow any pthread to receive the signal; is there a way to block that signal in all other threads (including newly spawned ones)?

Alternatively, I could set the handler on the top level - but then the thread that will handle the signal isn't specified and so could break other parts that don't expect to get interrupted.

Having (exactly) one thread that has the given signal unblocked and waits for the interruption seems to be the most sane way of proceeding, I guess.

Ah sorry, after some more reading that seems to be fine -- implementation-dependent, of course. (See the README)