From 7a0f281dc7595ef80befeeecf8948bc486e30ad9 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Tue, 10 Dec 2013 09:16:35 +0100 Subject: [PATCH] sysdbd: Send SIGINT to backend thread when shutting down. This will interrupt the sleep call and make the thread shut down faster. --- src/daemon/sysdbd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/daemon/sysdbd.c b/src/daemon/sysdbd.c index 4fbf48f..67d4515 100644 --- a/src/daemon/sysdbd.c +++ b/src/daemon/sysdbd.c @@ -171,6 +171,7 @@ static void * backend_handler(void __attribute__((unused)) *data) { sdb_plugin_collector_loop(&plugin_main_loop); + sdb_log(SDB_LOG_INFO, "Shutting down backend thread"); return NULL; } /* backend_handler */ @@ -281,6 +282,7 @@ main(int argc, char **argv) sdb_log(SDB_LOG_INFO, "Waiting for backend thread to terminate"); plugin_main_loop.do_loop = 0; + pthread_kill(backend_thread, SIGINT); pthread_join(backend_thread, NULL); sdb_fe_sock_destroy(sock); } -- 2.30.2