Two accesses to the same object of type
volatile std::sig_atomic_t do not
result in a data race if both occur in the same thread, even if one or more
occurs in a signal handler
. For each signal handler invocation, evaluations
performed by the thread invoking a signal handler can be divided into two
groups
A and
B, such that no evaluations in
B happen before evaluations in
A, and the
evaluations of such
volatile std::sig_atomic_t objects take values as though
all evaluations in
A happened before the execution of the signal
handler and the execution of the signal handler happened before all evaluations
in
B.