[Webkit-unassigned] [Bug 266649] Failure memory order cannot be release or acq_rel.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 22 08:32:03 PST 2023


https://bugs.webkit.org/show_bug.cgi?id=266649

--- Comment #4 from Mark Lam <mark.lam at apple.com> ---
(In reply to Mark Lam from comment #2)
> Can you please point us to the C++ spec where it says that using release or
> acq_rel for the failure memory order is undefined behavior?  Thanks.

>From https://en.cppreference.com/w/cpp/atomic/atomic/compare_exchange:
```
If failure is stronger than success or(until C++17) is one of std::memory_order_release and std::memory_order_acq_rel, the behavior is undefined.
```

Also, from that link, there's a table that says for `compare_exchange_strong`'s "load operation" in the failure mode, to use:
```
* std::memory_order_acquire if order is std::memory_order_acq_rel
* std::memory_order_relaxed if order is std::memory_order_release
* otherwise order
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20231222/9c92b05f/attachment-0001.htm>


More information about the webkit-unassigned mailing list