mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Prevent crash in certain multi-threaded situations. Bug 83508. r=markh, sr=jband, a=blizzard.
This commit is contained in:
parent
18073f24cc
commit
f7d8b996ba
@ -303,19 +303,15 @@ nsresult nsExceptionService::DoGetExceptionFromProvider( nsresult errCode, nsIEx
|
||||
|
||||
/*static*/ void nsExceptionService::DoDropThread(nsExceptionManager *thread)
|
||||
{
|
||||
if (thread == firstThread) {
|
||||
firstThread = nsnull;
|
||||
} else {
|
||||
nsExceptionManager *look = firstThread->mNextThread;
|
||||
while (look && look->mNextThread != thread) {
|
||||
look = look->mNextThread;
|
||||
}
|
||||
NS_ABORT_IF_FALSE(look, "Could not find the thread to drop!");
|
||||
if (look)
|
||||
look->mNextThread = thread->mNextThread;
|
||||
nsExceptionManager **emp = &firstThread;
|
||||
while (*emp != thread) {
|
||||
NS_ABORT_IF_FALSE(*emp, "Could not find the thread to drop!");
|
||||
emp = &(*emp)->mNextThread;
|
||||
}
|
||||
*emp = thread->mNextThread;
|
||||
NS_RELEASE(thread);
|
||||
}
|
||||
|
||||
/*static*/ void nsExceptionService::DropThread(nsExceptionManager *thread)
|
||||
{
|
||||
PR_Lock(lock);
|
||||
|
Loading…
Reference in New Issue
Block a user