ziglang / zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
https://ziglang.org
MIT License
33.67k stars 2.47k forks source link

Docs of @cmpxchgWeak and @cmpxchgStrong are wrong #20634

Closed lassade closed 1 month ago

lassade commented 1 month ago

Zig Version

master

Steps to Reproduce and Observed Behavior

Hey in the @cmpxchgWeak https://ziglang.org/documentation/master/#cmpxchgWeak docs states: "... returning null if the current value is NOT the given expected value ..."

I put the NOT in highlight because the pseudo code in the same section is telling me otherwise: it should return null if the value is the expected value.

Expected Behavior

@cmpxchgWeak and @cmpxchgStrong returns null if the value IS the expected value.

xdBronch commented 1 month ago

duplicate of https://github.com/ziglang/zig/issues/19979