On 11/25/19 3:55 AM, aliak wrote:
On Sunday, 24 November 2019 at 17:04:49 UTC, Steven Schveighoffer wrote:
On 11/24/19 10:44 AM, aliak wrote:
[...]
Hm.. are you sure that ctrl-c isn't also sending the signal to your
child process? I thought it did.
Yesh, you're right. That extra kill is unnecessary and was actually
causing problems. So thanks for that!
As a general rule though, I would say you should do as LITTLE as
possible inside your signal handler. Being inside a signal handler is
unlike any other function, because you can be called from anywhere.
Locks can be held that are not normally, etc.
Most of the time, I just set flags in signal handlers and handle them
asynchronously outside in my main loop.
-Steve