From c692199dd2f0b2bcc72bf7e9fa948d24d4254ee3 Mon Sep 17 00:00:00 2001 From: "edburns%acm.org" Date: Thu, 9 Nov 2000 23:49:57 +0000 Subject: [PATCH] bug 59526 sr=waterson r=valeski This bullet-proofs the code so the one thread does not exit twice. git-svn-id: svn://10.0.0.236/trunk@82513 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/threads/nsThread.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mozilla/xpcom/threads/nsThread.cpp b/mozilla/xpcom/threads/nsThread.cpp index 64a10fa5a52..ca4d8475a93 100644 --- a/mozilla/xpcom/threads/nsThread.cpp +++ b/mozilla/xpcom/threads/nsThread.cpp @@ -101,6 +101,12 @@ nsThread::Exit(void* arg) { nsThread* self = (nsThread*)arg; self->mDead = PR_TRUE; + + if (self->mDead) { + NS_ERROR("attempt to Exit() thread twice"); + return; + } + PR_LOG(nsIThreadLog, PR_LOG_DEBUG, ("nsIThread %p exited\n", self)); NS_RELEASE(self);