Skip to content

Atomics.wait()/waitAsync() improvements - #39679

Merged
Josh-Cena merged 10 commits into
mdn:mainfrom
hamishwillee:ff140_atomics_waitasync_doc
May 27, 2025
Merged

Josh-Cena merged 10 commits into
mdn:mainfrom
hamishwillee:ff140_atomics_waitasync_doc

Conversation

@hamishwillee

@hamishwillee hamishwillee commented May 26, 2025 •

Copy link
Copy Markdown
Collaborator

This improves the docs for Atomics.waitAsync() and Atomics.wait(). I found them a little unclear. I think it helps to link to notify() earlier.

Notes about what/why inline

Related docs work can be tracked in #39615

@hamishwillee
hamishwillee requested review from a team and Josh-Cena and removed request for a team May 26, 2025 06:48
@github-actions github-actions Bot added Content:JS JavaScript docs size/s [PR only] 6-50 LoC changed labels May 26, 2025
@github-actions

github-actions Bot commented May 26, 2025 •

Copy link
Copy Markdown
Contributor

method verifies that a shared memory location still contains a
given value and if so sleeps, awaiting a wake-up notification or times out. It returns a string which
is either `"ok"`, `"not-equal"`, or `"timed-out"`.
The **`Atomics.wait()`** static method verifies that a shared memory location contains a given value and if so sleeps, awaiting a wake-up notification or a time out.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This method doc I just didn't find very clear. In particular we were a bit unclear about "may not be used in main thread". If it throws an exception, it can't.

@hamishwillee
hamishwillee force-pushed the ff140_atomics_waitasync_doc branch from ec439ef to 717d204 Compare May 27, 2025 01:24
@hamishwillee
hamishwillee requested a review from Josh-Cena May 27, 2025 04:02

@Josh-Cena Josh-Cena left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! I made some tiny tweaks to the wording

@Josh-Cena
Josh-Cena merged commit 41d8fb5 into mdn:main May 27, 2025
zachernuk pushed a commit to zachernuk/content that referenced this pull request Jun 4, 2025
* Atomics.wait()/waitAsync() improvements

* Update files/en-us/web/javascript/reference/global_objects/atomics/wait/index.md

* Update files/en-us/web/javascript/reference/global_objects/atomics/wait/index.md

* Remove the note

* waitAsync returns and object

* Update files/en-us/web/javascript/reference/global_objects/atomics/wait/index.md

* Apply suggestions from code review

* Update index.md

* Update index.md

* Update index.md

---------

Co-authored-by: Joshua Chen <[email protected]>
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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