Atomics.wait should not be allowed on main thread, should throw
Reported by
jphe...@netflix.com,
Jan 30 2017
|
|||||
Issue descriptionUserAgent: 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"
,
Jan 30 2017
,
Jan 31 2017
,
Jan 31 2017
,
Feb 1 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/feca6e8c3446e2cb514eb72ef14e9b4dd44df163 commit feca6e8c3446e2cb514eb72ef14e9b4dd44df163 Author: binji <binji@chromium.org> Date: Wed Feb 01 23:16:11 2017 Atomics.wait throws when called on the main thread. BUG= 686604 R=jochen@chromium.org Review-Url: https://codereview.chromium.org/2660423003 Cr-Commit-Position: refs/heads/master@{#447639} [modify] https://crrev.com/feca6e8c3446e2cb514eb72ef14e9b4dd44df163/gin/isolate_holder.cc [modify] https://crrev.com/feca6e8c3446e2cb514eb72ef14e9b4dd44df163/gin/public/isolate_holder.h [add] https://crrev.com/feca6e8c3446e2cb514eb72ef14e9b4dd44df163/third_party/WebKit/LayoutTests/fast/workers/resources/worker-atomics-wait.js [add] https://crrev.com/feca6e8c3446e2cb514eb72ef14e9b4dd44df163/third_party/WebKit/LayoutTests/fast/workers/worker-atomics-wait-expected.txt [add] https://crrev.com/feca6e8c3446e2cb514eb72ef14e9b4dd44df163/third_party/WebKit/LayoutTests/fast/workers/worker-atomics-wait.html [add] https://crrev.com/feca6e8c3446e2cb514eb72ef14e9b4dd44df163/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/workers/worker-atomics-wait-expected.txt [modify] https://crrev.com/feca6e8c3446e2cb514eb72ef14e9b4dd44df163/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp
,
Feb 1 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/feca6e8c3446e2cb514eb72ef14e9b4dd44df163 commit feca6e8c3446e2cb514eb72ef14e9b4dd44df163 Author: binji <binji@chromium.org> Date: Wed Feb 01 23:16:11 2017 Atomics.wait throws when called on the main thread. BUG= 686604 R=jochen@chromium.org Review-Url: https://codereview.chromium.org/2660423003 Cr-Commit-Position: refs/heads/master@{#447639} [modify] https://crrev.com/feca6e8c3446e2cb514eb72ef14e9b4dd44df163/gin/isolate_holder.cc [modify] https://crrev.com/feca6e8c3446e2cb514eb72ef14e9b4dd44df163/gin/public/isolate_holder.h [add] https://crrev.com/feca6e8c3446e2cb514eb72ef14e9b4dd44df163/third_party/WebKit/LayoutTests/fast/workers/resources/worker-atomics-wait.js [add] https://crrev.com/feca6e8c3446e2cb514eb72ef14e9b4dd44df163/third_party/WebKit/LayoutTests/fast/workers/worker-atomics-wait-expected.txt [add] https://crrev.com/feca6e8c3446e2cb514eb72ef14e9b4dd44df163/third_party/WebKit/LayoutTests/fast/workers/worker-atomics-wait.html [add] https://crrev.com/feca6e8c3446e2cb514eb72ef14e9b4dd44df163/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/workers/worker-atomics-wait-expected.txt [modify] https://crrev.com/feca6e8c3446e2cb514eb72ef14e9b4dd44df163/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp
,
Feb 14 2017
,
Feb 14 2017
Looks good. Thanks jochen! |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by nyerramilli@chromium.org
, Jan 30 2017