Title
Races with volatile sig_atomic_t bit-fields
Status
open
Section
6.9.2.2 [intro.races]
Submitter
Hubert Tong

Created on 2024-12-17.00:00:00 last changed 4 days ago

Messages

Date: 2024-12-17.11:50:10

Suggested resolution:

Change in 6.9.2.2 [intro.races] paragraph 22 as follows:

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. ...
Date: 2024-12-17.00:00:00

(From submission #654.)

Subclause 6.9.2.2 [intro.races] paragraph 22 specifies:

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. ...

This provision applies to bit-fields as well, because bit-fields are objects (6.8.1 [basic.types.general] paragraph 4). However, in practice bit-fields are not updated atomically and are subject to tearing.

History
Date User Action Args
2024-12-17 11:50:10adminsetmessages: + msg7926
2024-12-17 00:00:00admincreate