Files
tubestation/dom/workers
Eden Chuang 872613c093 Bug 1911531 - Let the dispatched WorkerThreadRunnable be managed by WorkerPrivate::mPreStartRunnables. r=dom-worker-reviewers,asuth
WorkerThreadRunnable dispatching is racing with WorkerPrivate initialization.

When [[ https://searchfox.org/mozilla-central/rev/8b0666aff1197e1dd8017de366343de9c21ee437/dom/workers/WorkerPrivate.cpp#5912 | WorkerPrivate::SetWorkerPrivateInWorkerThread() ]] is called,  [[ https://searchfox.org/mozilla-central/rev/8b0666aff1197e1dd8017de366343de9c21ee437/dom/workers/WorkerPrivate.cpp#1628-1644,1662 | WorkerThreadRunnables are dispatched to WorkerThread main event queue directly even if the WorkerPrivate is in Pending ]]

However, WorkerPrivate initialization still can fail, and these dispatched runnables should not be executed.

To ensure these directly dispatched runnables have the correct mCleanPreStartDispatching value when WorkerPrivate::RunLoopNeverRan() is called, every runnable dispatched in Pending status should be in WorkerPrivate::mPreStartRunnables.

Differential Revision: https://phabricator.services.mozilla.com/D218619
2024-08-16 08:33:49 +00:00
..