From 162787fbbb33c3cae6cf6e4d5b8fadc4a51cff8f Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Thu, 6 Apr 2017 18:18:49 +0200 Subject: Make the signal flags volatile and atomic. This is needed to make sure the changes made in the signal handler are always visible in the main context. --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 6303a70..b58f143 100644 --- a/src/main.c +++ b/src/main.c @@ -125,8 +125,8 @@ out: pthread_mutex_unlock(&entry->mutex); } -static bool signals_terminate = false; -static bool signals_reload = false; +static volatile sig_atomic_t signals_terminate = false; +static volatile sig_atomic_t signals_reload = false; // NOTE: The code assumes that signal_handler will only be called in the main // thread, which (as far as I know) is always the case on Linux. -- cgit