Commit 9259434
[JSC] Atomics.waitAsync should be invocable from the main thread
https://bugs.webkit.org/show_bug.cgi?id=250518
Reviewed by Keith Miller.
According to the current proposed spec [1], async atomic waits are not
restricted to threads with `AgentCanSuspend()`--so, Atomics.waitAsync should not
throw a TypeError for this reason. I've added a (very simple) test to this
effect.
So, we should delay the check for `isAtomicsWaitAllowedOnCurrentThread` until after we know
the wait is known to be synchronous.
If there's an implementation reason we shouldn't do this, let me know, but I
couldn't find one.
[1] https://tc39.es/proposal-atomics-wait-async/#sec-dowait
* LayoutTests/js/Atomics-waitasync-invocable-on-main-thread-expected.txt: Added.
* LayoutTests/js/Atomics-waitasync-invocable-on-main-thread.html: Added.
* Source/JavaScriptCore/runtime/AtomicsObject.cpp:
(JSC::atomicsWaitImpl):
Canonical link: https://commits.webkit.org/258856@main1 parent 2a6683c commit 9259434
File tree
3 files changed
+36
-5
lines changed- LayoutTests/js
- Source/JavaScriptCore/runtime
3 files changed
+36
-5
lines changedLines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
452 | 455 | | |
453 | | - | |
454 | | - | |
| 456 | + | |
455 | 457 | | |
456 | 458 | | |
457 | 459 | | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | 460 | | |
462 | 461 | | |
463 | 462 | | |
| |||
0 commit comments