Prevent crash in certain multi-threaded situations. Bug 83508. r=markh, sr=jband, a=blizzard.

This commit is contained in:
markh%activestate.com 2001-06-04 23:01:26 +00:00
parent 18073f24cc
commit f7d8b996ba

View File

@ -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);