Two accesses to the same object of type
volatile std::sig_atomic_t do notresult in a data race if both occur in the same thread, even if one or moreoccurs in a signal handler
.For each signal handler invocation, evaluationsperformed by the thread invoking a signal handler can be divided into twogroups
A and
B, such that no evaluations in
B happen before evaluations in
A, and theevaluations of such
volatile std::sig_atomic_t objects take values as thoughall evaluations in
A happened before the execution of the signalhandler and the execution of the signal handler happened before all evaluationsin
B.