зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1584396
- Do not assert about other thread dispatches at worker shutdown. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D78836
This commit is contained in:
Родитель
0598a2925f
Коммит
65818c219e
|
@ -127,10 +127,12 @@ void WorkerThread::SetWorker(const WorkerThreadFriendKey& /* aKey */,
|
|||
|
||||
MOZ_ASSERT(mWorkerPrivate);
|
||||
MOZ_ASSERT(!mAcceptingNonWorkerRunnables);
|
||||
MOZ_ASSERT(!mOtherThreadsDispatchingViaEventTarget,
|
||||
"XPCOM Dispatch hapenning at the same time our thread is "
|
||||
"being unset! This should not be possible!");
|
||||
|
||||
// mOtherThreadsDispatchingViaEventTarget can still be non-zero here
|
||||
// because WorkerThread::Dispatch isn't atomic so a thread initiating
|
||||
// dispatch can have dispatched a runnable at this thread allowing us to
|
||||
// begin shutdown before that thread gets a chance to decrement
|
||||
// mOtherThreadsDispatchingViaEventTarget back to 0. So we need to wait
|
||||
// for that.
|
||||
while (mOtherThreadsDispatchingViaEventTarget) {
|
||||
mWorkerPrivateCondVar.Wait();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче