mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 06:09:19 +00:00
Bug 1928769 - Stop holding a mutex across gIPCLaunchThread shutdown, r=ipc-reviewers,jld
Differential Revision: https://phabricator.services.mozilla.com/D227761
This commit is contained in:
parent
cfd4996e68
commit
372214f2e1
@ -982,13 +982,14 @@ NS_IMETHODIMP
|
||||
IPCLaunchThreadObserver::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
const char16_t* aData) {
|
||||
MOZ_RELEASE_ASSERT(strcmp(aTopic, "xpcom-shutdown-threads") == 0);
|
||||
StaticMutexAutoLock lock(gIPCLaunchThreadMutex);
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
if (gIPCLaunchThread) {
|
||||
rv = gIPCLaunchThread->Shutdown();
|
||||
gIPCLaunchThread = nullptr;
|
||||
nsCOMPtr<nsIThread> thread;
|
||||
{
|
||||
StaticMutexAutoLock lock(gIPCLaunchThreadMutex);
|
||||
thread = gIPCLaunchThread.forget();
|
||||
}
|
||||
|
||||
nsresult rv = thread ? thread->Shutdown() : NS_OK;
|
||||
mozilla::Unused << NS_WARN_IF(NS_FAILED(rv));
|
||||
return rv;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user