Use store() instead of operator=() for std::atomic<bool> objects

This commit is contained in:
Florent Le Coz
2014-02-24 21:02:21 +01:00
parent 541af5236e
commit 5f82c93754
+4 -4
View File
@@ -34,12 +34,12 @@ int config_help(const std::string& missing_option)
static void sigint_handler(int, siginfo_t*, void*) static void sigint_handler(int, siginfo_t*, void*)
{ {
stop = true; stop.store(true);
} }
static void sigusr_handler(int, siginfo_t*, void*) static void sigusr_handler(int, siginfo_t*, void*)
{ {
reload = true; reload.store(true);
} }
int main(int ac, char** av) int main(int ac, char** av)
@@ -100,7 +100,7 @@ int main(int ac, char** av)
{ {
log_info("Signal received, exiting..."); log_info("Signal received, exiting...");
exiting = true; exiting = true;
stop = false; stop.store(false);
xmpp_component->shutdown(); xmpp_component->shutdown();
} }
if (reload) if (reload)
@@ -112,7 +112,7 @@ int main(int ac, char** av)
// Destroy the logger instance, to be recreated the next time a log // Destroy the logger instance, to be recreated the next time a log
// line needs to be written // line needs to be written
Logger::instance().reset(); Logger::instance().reset();
reload = false; reload.store(false);
} }
// If the only existing connection is the one to the XMPP component: // If the only existing connection is the one to the XMPP component:
// close the XMPP stream. // close the XMPP stream.