forked from mirrors/gecko-dev
There are currently some odd circumstances where we deadlock waiting for the background save thread to finish while it is blocked on sync dispatch to the main thread during shutdown. There were existing workarounds to prevent this, which tried to synchronously complete the main thread work required by the background thread at the start of shutdown, and some fallback anti-deadlock assertions to catch any remaining corner cases, but apparently Fennec has corner cases of its own that we didn't anticipate. This patch takes the more straightforward route of using an async shutdown blocker, which allows the async shutdown service to safely spin the event loop until the save completes, rather than an independent monitor loop, which does not. It also fixes a potential data race where the save thread could clear its mSaveThread member before NS_NewNamedThread returned, running afoul of nsCOMPtr sanity checks. Differential Revision: https://phabricator.services.mozilla.com/D28127 --HG-- extra : rebase_source : 4aed24f4a255063d87dff2609e9913418d5c16fa
15 lines
583 B
Python
15 lines
583 B
Python
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
|
# vim: set filetype=python:
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
Classes = [
|
|
{
|
|
'name': 'AsyncShutdown',
|
|
'cid': '{35c496de-a115-475d-93b5-ffa3f3ae6fe3}',
|
|
'contract_ids': ['@mozilla.org/async-shutdown-service;1'],
|
|
'jsm': 'resource://gre/modules/nsAsyncShutdown.jsm',
|
|
'constructor': 'nsAsyncShutdownService',
|
|
},
|
|
]
|