Linux signal handling - notifying a condition variable

Patrick Schluter Patrick.Schluter at bbox.fr
Thu Mar 15 19:43:09 UTC 2018


On Thursday, 15 March 2018 at 16:51:59 UTC, Jim King wrote:
> I am trying to add graceful shutdown support to a test harness.
>  In the test harness, a server class consumes a thread to 
> accept connections and service them.  In order to stop the 
> server, it has to be interrupted.  This interruption mechanism 
> is based on core.sync.condition.
>
> I want to add a signal handler so that if SIGINT is received, 
> the server is interrupted and stops gracefully.
>

signalfd [1] is a good solution on Linux.

core.sys.linux.sys.signalfd;

[1]: http://man7.org/linux/man-pages/man2/signalfd.2.html


More information about the Digitalmars-d mailing list