K
K
kodwi2015-10-14 00:49:46
linux
kodwi, 2015-10-14 00:49:46

How to make SIGINT caught only by the main thread of the process?

The daemon in the main thread starts n children, while there is an overridden SIGINT handler. Everything seems to be fine, but when SIGINT is sent by the user (ctrl + c), a random thread catches it. And it is necessary that always only the main thread catches the signal in order to correctly terminate the daemon. Tell me what to google, where to dig on this issue?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nadz Goldman, 2015-10-14
@kodwi

There is a great example here .
And here is something to read.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question