diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-04-06 18:18:49 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-04-06 18:18:49 +0200 |
commit | 162787fbbb33c3cae6cf6e4d5b8fadc4a51cff8f (patch) | |
tree | 4b869853081a7ffcabd3ade9bf084a98f43cbdab | |
parent | 1d06764d0685a552d8ac6ea055bfbfbbf6dfd4da (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.
-rw-r--r-- | src/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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. |