<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 3, 2014 at 3:11 PM, Sebastian Redl <span dir="ltr"><<a href="mailto:sebastian.redl@getdesigned.at" target="_blank">sebastian.redl@getdesigned.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br>
On Mar 3, 2014, at 22:59, Richard Smith wrote:<br>
<br>
> OK, so... the standard does imply that the 'expected' access is non-atomic, which means that the case described in PR18899 already contains a data race (between the load of 'expected' in the __atomic_compare_exchange and the hypothesized store in another thread)<br>

<br>
</div>The case I described there doesn't contain a race, because the memory location in question isn't visible to any other threads until the compare_exchange succeeds. The load from 'expected' happens-before the successful write, which synchronizes-with any load from the atomic in another thread that makes the memory location of 'expected' visible to another thread.</blockquote>
<div><br></div><div>Yes, you're quite right =) </div></div></div></div>