New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 686604 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner:
Last visit 15 days ago
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Atomics.wait should not be allowed on main thread, should throw

Reported by jphe...@netflix.com, Jan 30 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36

Steps to reproduce the problem:
1. Create a SharedArrayBuffer
2. Create a Int32Array of that buffer
3. On the main thread, call Atomics.wait() on that buffer

What is the expected behavior?
An exception is thrown.

What went wrong?
The main thread goes to sleep. Closing that tab becomes very difficult for novices.

Did this work before? No 

Does this work in other browsers? Yes

Chrome version: 58.0.2995.0  Channel: n/a
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 24.0 r0

The spec carved out a specific exemption allowing vendors to disallow blocking on specific threads, usually the main thread of a browser window. Certainly Chromium could decide they want to allow it, but I'm guessing you probably don't.

> Browsers will typically let agents that run on the browser's main thread have [[CanBlock]] equal to false, to prevent blocking the UI and to allow the main thread to do work on behalf of other threads.

Spec: http://tc39.github.io/ecmascript_sharedmem/shmem.html#WebBrowserEmbedding

Firefox Nightly 54.0a1 (2017-01-28) throws: "Error: waiting is not allowed on this thread"
 
test.html
291 bytes View Download
Labels: Needs-Triage-M58

Comment 2 by rsesek@chromium.org, Jan 30 2017

Components: Blink>JavaScript
Cc: littledan@chromium.org adamk@chromium.org
Components: -Blink>JavaScript Blink>JavaScript>Language
Labels: -Type-Bug Type-Feature
Status: Available (was: Unconfirmed)

Comment 4 by adamk@chromium.org, Jan 31 2017

Labels: -Type-Feature Type-Bug
Owner: binji@chromium.org
Status: Assigned (was: Available)

Comment 7 by binji@chromium.org, Feb 14 2017

Status: Fixed (was: Assigned)

Comment 8 by jphe...@netflix.com, Feb 14 2017

Looks good. Thanks jochen!

Sign in to add a comment