From: Sebastian Harl Date: Tue, 10 Dec 2013 08:16:35 +0000 (+0100) Subject: sysdbd: Send SIGINT to backend thread when shutting down. X-Git-Tag: sysdb-0.1.0~319 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7a0f281dc7595ef80befeeecf8948bc486e30ad9;p=sysdb.git sysdbd: Send SIGINT to backend thread when shutting down. This will interrupt the sleep call and make the thread shut down faster. --- 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); }