summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-04-06 18:18:49 +0200
committerPaweł Redman <pawel.redman@gmail.com>2017-04-06 18:18:49 +0200
commit162787fbbb33c3cae6cf6e4d5b8fadc4a51cff8f (patch)
tree4b869853081a7ffcabd3ade9bf084a98f43cbdab /src
parent1d06764d0685a552d8ac6ea055bfbfbbf6dfd4da (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/main.c4
1 files 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.