Loading src/event/epoll.cpp +5 −1 Changes for src/event/epoll.cpp: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -797,7 +797,7 @@ namespace netplus { // runEventloop() after all threads have joined. // ------------------------------------------------------------ static void signalHandler(int signum) { if (signum != SIGINT) if (signum != SIGINT && signum != SIGTERM) return; event::Running = false; // Wake up all epoll_wait calls so threads notice Running==false immediately. Loading Loading @@ -885,6 +885,10 @@ namespace netplus { void event::runEventloop(ULONG_PTR args) { signal(SIGINT, signalHandler); // SIGTERM is what init systems and `docker stop` send: without it the // process died without returning from the loop, so no destructor ran // (buffered stores lost their unflushed writes). signal(SIGTERM, signalHandler); signal(SIGPIPE, SIG_IGN); // Create the global wakeup eventfd once per run. Loading src/event/kqueue.cpp +5 −1 Changes for src/event/kqueue.cpp: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -901,7 +901,7 @@ namespace netplus { // runEventloop() after all threads have joined. // ------------------------------------------------------------ static void signalHandler(int signum) { if (signum != SIGINT) if (signum != SIGINT && signum != SIGTERM) return; event::Running = false; // Wake up all kevent() calls so threads notice Running==false immediately. Loading Loading @@ -985,6 +985,10 @@ netplus::event::~event() {} void netplus::event::runEventloop(ULONG_PTR args) { signal(SIGINT, netplus::signalHandler); // SIGTERM is what init systems and `docker stop` send: without it the // process died without returning from the loop, so no destructor ran // (buffered stores lost their unflushed writes). signal(SIGTERM, netplus::signalHandler); signal(SIGPIPE, SIG_IGN); // Create the global wakeup pipe once per run. Loading src/event/poll.cpp +5 −1 Changes for src/event/poll.cpp: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -725,7 +725,7 @@ namespace netplus { // ------------------------------------------------------------ #ifndef _WIN32 static void signalHandler(int signum) { if (signum != SIGINT) if (signum != SIGINT && signum != SIGTERM) return; event::Running = false; } Loading Loading @@ -823,6 +823,10 @@ namespace netplus { void event::runEventloop(ULONG_PTR args) { #ifndef _WIN32 signal(SIGINT, signalHandler); // SIGTERM is what init systems and `docker stop` send: without it the // process died without returning from the loop, so no destructor ran // (buffered stores lost their unflushed writes). signal(SIGTERM, signalHandler); signal(SIGPIPE, SIG_IGN); #endif Loading Loading
src/event/epoll.cpp +5 −1 Changes for src/event/epoll.cpp: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -797,7 +797,7 @@ namespace netplus { // runEventloop() after all threads have joined. // ------------------------------------------------------------ static void signalHandler(int signum) { if (signum != SIGINT) if (signum != SIGINT && signum != SIGTERM) return; event::Running = false; // Wake up all epoll_wait calls so threads notice Running==false immediately. Loading Loading @@ -885,6 +885,10 @@ namespace netplus { void event::runEventloop(ULONG_PTR args) { signal(SIGINT, signalHandler); // SIGTERM is what init systems and `docker stop` send: without it the // process died without returning from the loop, so no destructor ran // (buffered stores lost their unflushed writes). signal(SIGTERM, signalHandler); signal(SIGPIPE, SIG_IGN); // Create the global wakeup eventfd once per run. Loading
src/event/kqueue.cpp +5 −1 Changes for src/event/kqueue.cpp: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -901,7 +901,7 @@ namespace netplus { // runEventloop() after all threads have joined. // ------------------------------------------------------------ static void signalHandler(int signum) { if (signum != SIGINT) if (signum != SIGINT && signum != SIGTERM) return; event::Running = false; // Wake up all kevent() calls so threads notice Running==false immediately. Loading Loading @@ -985,6 +985,10 @@ netplus::event::~event() {} void netplus::event::runEventloop(ULONG_PTR args) { signal(SIGINT, netplus::signalHandler); // SIGTERM is what init systems and `docker stop` send: without it the // process died without returning from the loop, so no destructor ran // (buffered stores lost their unflushed writes). signal(SIGTERM, netplus::signalHandler); signal(SIGPIPE, SIG_IGN); // Create the global wakeup pipe once per run. Loading
src/event/poll.cpp +5 −1 Changes for src/event/poll.cpp: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -725,7 +725,7 @@ namespace netplus { // ------------------------------------------------------------ #ifndef _WIN32 static void signalHandler(int signum) { if (signum != SIGINT) if (signum != SIGINT && signum != SIGTERM) return; event::Running = false; } Loading Loading @@ -823,6 +823,10 @@ namespace netplus { void event::runEventloop(ULONG_PTR args) { #ifndef _WIN32 signal(SIGINT, signalHandler); // SIGTERM is what init systems and `docker stop` send: without it the // process died without returning from the loop, so no destructor ran // (buffered stores lost their unflushed writes). signal(SIGTERM, signalHandler); signal(SIGPIPE, SIG_IGN); #endif Loading