-
jameslahm authored
There are problems calling WaitForRunningWorkers when we call quit(). First, suppose the main thread first calls quit(), and the worker thread calls quit() after the main thread calls quit(), then sched_yield to wait for quit_once_ updated to ONCE_STATE_DONE. However the main thread is WaitForRunningWorkers to wait for the worker thread to join, thus causing deadlock. Second, suppose the worker thread calls quit() and empty the running_workers_ by WaitForRunningWorkers, then the main thread calls `onExit(isolate, true)` to dispose the platform and other global data, which will crash other running workers. Bug: v8:12219 Change-Id: I333e5aad431daefb1c163f69e66d8e9d5e9bf754 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3518908Reviewed-by: Marja Hölttä <marja@chromium.org> Commit-Queue: Marja Hölttä <marja@chromium.org> Cr-Commit-Position: refs/heads/main@{#79525}
d8c9b089