zig
zig copied to clipboard
Update wording for @cmpxchgStrong and @cmpxchgWeak in langref.html.in
The previous wording was incorrect as it indicated that @cmpxchgStrong and @cmpxchgWeak return null on "failure" even though it returns null on success and the current value of the atomic on "failure", closes #19979.
Further documentation might be helpful as described in #1516.
@andrewrk Would you mind have a look at this?
The doc is very misleading.
I decided to take #21755 because it was a simpler and more obvious fix that immediately resolves the confusion. I think the docs for these builtins could do with a complete rewrite in the longer term though, not just this one sentence.
In any case, thanks for taking a stab at this!