mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 557586 - XPCPerThreadData::~XPCPerThreadData race leading to possible crash r=timeless
This commit is contained in:
parent
a9bd025310
commit
9d2ca11113
@ -387,6 +387,11 @@ XPCPerThreadData::Cleanup()
|
||||
|
||||
XPCPerThreadData::~XPCPerThreadData()
|
||||
{
|
||||
/* Be careful to ensure that both any update to |gThreads| and the
|
||||
decision about whether or not to destroy the lock, are done
|
||||
atomically. See bug 557586. */
|
||||
PRBool doDestroyLock = PR_FALSE;
|
||||
|
||||
MOZ_COUNT_DTOR(xpcPerThreadData);
|
||||
|
||||
Cleanup();
|
||||
@ -410,9 +415,11 @@ XPCPerThreadData::~XPCPerThreadData()
|
||||
cur = cur->mNextThread;
|
||||
}
|
||||
}
|
||||
if (!gThreads)
|
||||
doDestroyLock = PR_TRUE;
|
||||
}
|
||||
|
||||
if(gLock && !gThreads)
|
||||
if(gLock && doDestroyLock)
|
||||
{
|
||||
PR_DestroyLock(gLock);
|
||||
gLock = nsnull;
|
||||
|
Loading…
Reference in New Issue
Block a user