Description
Full name of submitter (unless configured in github; will be published with the issue): Hubert Tong
Reference (section label): intro.races
Link to reflector thread (if any): N/A
Issue description:
https://wg21.link/intro.races#22 says:
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.
However: Bit-fields are objects (https://wg21.link/basic.types.general#4), and volatile std::sig_atomic_t
bit-field accesses are subject to tearing in practice and, therefore, should formally receive the data-race treatment.
Suggested resolution:
Two accesses to the same non-bit-field 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.