You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
jensmaurer
changed the title
[intro.races] Races in practice with volatile sig_atomic_t bit-fields
CWG2970 [intro.races] Races in practice with volatile sig_atomic_t bit-fields
Dec 17, 2024
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:
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:
The text was updated successfully, but these errors were encountered: