From ae5b1a9ca2d0d2fb80e8ed3d9a8eb7cdd32aa219 Mon Sep 17 00:00:00 2001 From: isaac yonemoto Date: Sun, 20 Oct 2024 11:09:04 -0500 Subject: [PATCH] langref: fixes incorrect description of cmpxchg functions --- doc/langref.html.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index a463c0448f..3c45d52b1b 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -4536,7 +4536,7 @@ comptime {
{#syntax#}@cmpxchgStrong(comptime T: type, ptr: *T, expected_value: T, new_value: T, success_order: AtomicOrder, fail_order: AtomicOrder) ?T{#endsyntax#}

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:

{#code|not_atomic_cmpxchgStrong.zig#} @@ -4558,7 +4558,7 @@ comptime {
{#syntax#}@cmpxchgWeak(comptime T: type, ptr: *T, expected_value: T, new_value: T, success_order: AtomicOrder, fail_order: AtomicOrder) ?T{#endsyntax#}

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:

{#syntax_block|zig|cmpxchgWeakButNotAtomic#}