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 |
||
|---|---|---|
| .. | ||
| tests/xpcshell | ||
| AsyncShutdown.jsm | ||
| components.conf | ||
| moz.build | ||
| nsAsyncShutdown.jsm | ||
| nsIAsyncShutdown.idl | ||