mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
Fix theoretical race in signal handler
This commit is contained in:
parent
c4145e9ef1
commit
f6c1f5dc0f
|
@ -12,12 +12,13 @@
|
||||||
#include <poll.h> // for the interactive mode
|
#include <poll.h> // for the interactive mode
|
||||||
#include <csignal> // catching system signals
|
#include <csignal> // catching system signals
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
volatile sig_atomic_t gSignalStatus = 0;
|
std::atomic<sig_atomic_t> gSignalStatus(0);
|
||||||
|
|
||||||
extern "C" auto signal_handler(int signal) -> void
|
extern "C" auto signal_handler(int signal) -> void
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user