bug 1502841 - follow-up to ensure reentering DataStorageSharedThread::Shutdown() doesn't cause problems r=jcj
authorDana Keeler <dkeeler@mozilla.com>
Fri, 16 Nov 2018 16:14:52 +0000
changeset 503245 f38aa27974eea413de93123272629af54443ec0b
parent 503244 2c6f77ee5cf5b4f387ea870fda2a80f24d028b25
child 503246 32aa5695f2ca06124214d447fda352709ea2736c
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjcj
bugs1502841
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1502841 - follow-up to ensure reentering DataStorageSharedThread::Shutdown() doesn't cause problems r=jcj We shouldn't reenter DataStorageSharedThread::Shutdown(), but it may be possible. To guard against potentially attempting to shut down the shared thread more than once, we can check gDataStorageSharedThreadShutDown first. Differential Revision: https://phabricator.services.mozilla.com/D12050
security/manager/ssl/DataStorage.cpp
--- a/security/manager/ssl/DataStorage.cpp
+++ b/security/manager/ssl/DataStorage.cpp
@@ -105,17 +105,17 @@ DataStorageSharedThread::Initialize()
 }
 
 nsresult
 DataStorageSharedThread::Shutdown()
 {
   MOZ_ASSERT(XRE_IsParentProcess());
   StaticMutexAutoLock lock(sDataStorageSharedThreadMutex);
 
-  if (!gDataStorageSharedThread) {
+  if (!gDataStorageSharedThread || gDataStorageSharedThreadShutDown) {
     return NS_OK;
   }
 
   MOZ_ASSERT(gDataStorageSharedThread->mThread);
   if (!gDataStorageSharedThread->mThread) {
     return NS_ERROR_FAILURE;
   }