diff --git a/ipc/glue/AsyncChannel.cpp b/ipc/glue/AsyncChannel.cpp index 1b7a06ebf60..0af0b88f12b 100644 --- a/ipc/glue/AsyncChannel.cpp +++ b/ipc/glue/AsyncChannel.cpp @@ -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) {