mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
langref: fixes incorrect description of cmpxchg functions
This commit is contained in:
parent
658a4a527c
commit
ae5b1a9ca2
1 changed files with 2 additions and 2 deletions
|
|
@ -4536,7 +4536,7 @@ comptime {
|
|||
<pre>{#syntax#}@cmpxchgStrong(comptime T: type, ptr: *T, expected_value: T, new_value: T, success_order: AtomicOrder, fail_order: AtomicOrder) ?T{#endsyntax#}</pre>
|
||||
<p>
|
||||
This function performs a strong atomic compare-and-exchange operation, returning {#syntax#}null{#endsyntax#}
|
||||
if the current value is not the given expected value. It's the equivalent of this code,
|
||||
if the current value is the given expected value. It's the equivalent of this code,
|
||||
except atomic:
|
||||
</p>
|
||||
{#code|not_atomic_cmpxchgStrong.zig#}
|
||||
|
|
@ -4558,7 +4558,7 @@ comptime {
|
|||
<pre>{#syntax#}@cmpxchgWeak(comptime T: type, ptr: *T, expected_value: T, new_value: T, success_order: AtomicOrder, fail_order: AtomicOrder) ?T{#endsyntax#}</pre>
|
||||
<p>
|
||||
This function performs a weak atomic compare-and-exchange operation, returning {#syntax#}null{#endsyntax#}
|
||||
if the current value is not the given expected value. It's the equivalent of this code,
|
||||
if the current value is the given expected value. It's the equivalent of this code,
|
||||
except atomic:
|
||||
</p>
|
||||
{#syntax_block|zig|cmpxchgWeakButNotAtomic#}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue