Re: incorrect use of 'pure' attribute

Paul Eggert <[email protected]>
Newsgroups gmane.comp.lib.gnulib.bugs
Message-ID <[email protected]>
On 8/8/26 16:52, Bruno Haible via Gnulib discussion list wrote:
> Storing the same value in the same location (of
> type 'int') is OK not only on those platforms where an 'int' access is atomic,
> but even on architectures (such as m68k) where it isn't.

This variable is 'long', not 'int'.

Come to think of it, though, on GNU/Hurd aren't we in a bit of trouble 
here? One thread might be writing -1 while another is reading, and a 
torn read might cause the latter to see "65535" instead of -1.

We needn't go to atomic accesses to fix this, I'd think, just to a 
volatile bool saying whether the long int is initialized, along with 
rejiggering the accesses to the long int.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.