Bug 20122 – core.atomic.cas discards result on failure
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-08-12T02:58:44Z
Last change time
2019-08-13T10:08:48Z
Keywords
pull
Assigned to
No Owner
Creator
Manu
Comments
Comment #0 by turkeyman — 2019-08-12T02:58:44Z
The implementation of `cas` discards the result when the compare fails.
This is a strange choice, and not desirable.
There needs to be additional overloads that actually return the result.
Comment #1 by dlang-bot — 2019-08-13T07:50:56Z
@TurkeyMan created dlang/druntime pull request #2733 "Fixed the cas function not returning the result" fixing this issue:
- Fix Issue 20122 - core.atomic.cas discards result on failure
Added overloads that return the result.
https://github.com/dlang/druntime/pull/2733
Comment #2 by dlang-bot — 2019-08-13T10:08:48Z
dlang/druntime pull request #2733 "Fixed the cas function not returning the result" was merged into master:
- 5276bef147346a4b0adfae0eb7f7381efafb382a by Manu Evans:
Fix Issue 20122 - core.atomic.cas discards result on failure
Added overloads that return the result.
https://github.com/dlang/druntime/pull/2733