This MR uses what seems to be the best way to deal with Atomics.wait(view, index, control, ...rest) which is by doubling the buffer for the "first contact" and reading the result out of the view[1] index instead, reserving view[0] for just the control value.
This MRs also avoid locking forever workers when stuff breaks on main so that they can be freed and an error will be still thrown when/if needed, without actually letting workers hang forever.
To know more about this solution please read the ugly exchange at Mozilla https://bugzilla.mozilla.org/show_bug.cgi?id=1858092#c7 but after testing current branch in all major browsers I am confident this is the right thing to do, even if the previous hack on -1 was already solving the issue.
This MR uses what seems to be the best way to deal with
Atomics.wait(view, index, control, ...rest)
which is by doubling the buffer for the "first contact" and reading the result out of theview[1]
index instead, reservingview[0]
for just the control value.This MRs also avoid locking forever workers when stuff breaks on main so that they can be freed and an error will be still thrown when/if needed, without actually letting workers hang forever.
To know more about this solution please read the ugly exchange at Mozilla https://bugzilla.mozilla.org/show_bug.cgi?id=1858092#c7 but after testing current branch in all major browsers I am confident this is the right thing to do, even if the previous hack on
-1
was already solving the issue.