Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarity change: make it clear that Atomics.notify() always causes Atomics.wait() to return #37742

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

RPGillespie6
Copy link
Contributor

@RPGillespie6 RPGillespie6 commented Jan 21, 2025

Description

  • The docs currently can be interpreted that a sleeping Atomics.wait() will never move on unless the expected value changes ("As long as that is true, it will not go on")
  • Updated docs to make it more clear under what conditions Atomics.wait() can return which value

Motivation

I wasted many hours debugging an intermittent issue with a SharedArrayBuffer system due to an initial misinterpretation of MDN docs. I eventually opened a bug ticket in Bugzilla, and the behavior was clarified by André Bargull.

Additional details

@RPGillespie6 RPGillespie6 requested a review from a team as a code owner January 21, 2025 17:22
@RPGillespie6 RPGillespie6 requested review from Josh-Cena and removed request for a team January 21, 2025 17:22
@github-actions github-actions bot added Content:JS JavaScript docs size/s [PR only] 6-50 LoC changed labels Jan 21, 2025
…mics.wait() to return

- The docs currently can be interpreted that a sleeping `Atomics.wait()` will never move on unless the expected value changes
- Clarified that this is not the case by André Bargull in https://bugzilla.mozilla.org/show_bug.cgi?id=1942674
- Updated docs to make it more clear under what conditions `Atomics.wait()` can return which value
Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks!

@Josh-Cena Josh-Cena merged commit bdc8bdc into mdn:main Jan 22, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:JS JavaScript docs size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants