You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for @cmpxchgStrong and @cmpxchgWeak says:
This function performs a [strong|weak] atomic compare-and-exchange operation, returning `null` if the current value is not the given expected value.
It's the equivalent of this code, except atomic:
[...]
This is wrong and does not match the behavior of either the builtin nor the code example below these descriptions.
I would like to open a PR for this, but I am unsure in which file to implement it, my assumption was doc/langref.html.in but that appears to be auto-generated.
Expected Behavior
I would propose the following wording:
This function performs a [strong|weak] atomic compare-and-exchange operation, returning `null` if the operation was successful and the previous value matched the given expected value.
Otherwise, it returns the actual value.
It's the equivalent of this code, except atomic:
[...]
The text was updated successfully, but these errors were encountered:
I would like to open a PR for this, but I am unsure in which file to implement it, my assumption was doc/langref.html.in but that appears to be auto-generated.
Your assumption was correct, doc/langref.html.in is main template is located (it's not auto-generated) and doc/langref/ is where code examples are located. They are then processed by doctest to add recorded outputs and by docgen to generate final langref.html file. These are from tools/, but build.zig has langref step that calls them automatically.
Zig Version
0.12.0
Steps to Reproduce and Observed Behavior
The documentation for @cmpxchgStrong and @cmpxchgWeak says:
This is wrong and does not match the behavior of either the builtin nor the code example below these descriptions.
I would like to open a PR for this, but I am unsure in which file to implement it, my assumption was doc/langref.html.in but that appears to be auto-generated.
Expected Behavior
I would propose the following wording:
The text was updated successfully, but these errors were encountered: