Bug 543764 - Crash at PR_Unlock when mozilla-runtime exits/crashes. Ensure that NotifyMaybeChannelError waits until OnChannelError is completely finished running, r=cjones

This commit is contained in:
Ben Turner 2010-02-18 09:24:03 -05:00
parent b8b6c1c39e
commit 9ce0e5ccd5

View File

@ -294,6 +294,15 @@ AsyncChannel::NotifyChannelClosed()
void
AsyncChannel::NotifyMaybeChannelError()
{
// OnChannelError holds mMutex when it posts this task and this task cannot
// be allowed to run until OnChannelError has exited. We enforce that order
// by grabbing the mutex here which should only continue once OnChannelError
// has completed.
{
MutexAutoLock lock(mMutex);
// Nothing to do!
}
// TODO sort out Close() on this side racing with Close() on the
// other side
if (ChannelClosing == mChannelState) {