diff --git a/dom/file/ipc/Blob.cpp b/dom/file/ipc/Blob.cpp index 2fa285b51554..cbd0fb348cce 100644 --- a/dom/file/ipc/Blob.cpp +++ b/dom/file/ipc/Blob.cpp @@ -1015,20 +1015,12 @@ RemoteInputStream::ReallyBlockAndWaitForStream() { MonitorAutoLock lock(mMonitor); + waited = !mStream; - } - nsIThread* currentThread = NS_GetCurrentThread(); - MOZ_ASSERT(currentThread); - - while (true) { - { - MonitorAutoLock lock(mMonitor); - if (mStream) { - break; - } + while (!mStream) { + mMonitor.Wait(); } - MOZ_ALWAYS_TRUE(NS_ProcessNextEvent(currentThread)); } MOZ_ASSERT(mStream);