Skip to content

Commit ae5b1a9

Browse files
ityonemoalexrp
authored andcommitted
langref: fixes incorrect description of cmpxchg functions
1 parent 658a4a5 commit ae5b1a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/langref.html.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -4536,7 +4536,7 @@ comptime {
45364536
<pre>{#syntax#}@cmpxchgStrong(comptime T: type, ptr: *T, expected_value: T, new_value: T, success_order: AtomicOrder, fail_order: AtomicOrder) ?T{#endsyntax#}</pre>
45374537
<p>
45384538
This function performs a strong atomic compare-and-exchange operation, returning {#syntax#}null{#endsyntax#}
4539-
if the current value is not the given expected value. It's the equivalent of this code,
4539+
if the current value is the given expected value. It's the equivalent of this code,
45404540
except atomic:
45414541
</p>
45424542
{#code|not_atomic_cmpxchgStrong.zig#}
@@ -4558,7 +4558,7 @@ comptime {
45584558
<pre>{#syntax#}@cmpxchgWeak(comptime T: type, ptr: *T, expected_value: T, new_value: T, success_order: AtomicOrder, fail_order: AtomicOrder) ?T{#endsyntax#}</pre>
45594559
<p>
45604560
This function performs a weak atomic compare-and-exchange operation, returning {#syntax#}null{#endsyntax#}
4561-
if the current value is not the given expected value. It's the equivalent of this code,
4561+
if the current value is the given expected value. It's the equivalent of this code,
45624562
except atomic:
45634563
</p>
45644564
{#syntax_block|zig|cmpxchgWeakButNotAtomic#}

0 commit comments

Comments
 (0)