Commit b45a99eb authored by Kershaw Chang's avatar Kershaw Chang
Browse files

Bug 1736385 - Make sure thread is alive in CacheIOThread::ThreadFunc, a=RyanVM

parent e455ad39
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -380,6 +380,7 @@ void CacheIOThread::ThreadFunc() {
    if (threadInternal) threadInternal->SetObserver(this);
    if (threadInternal) threadInternal->SetObserver(this);


    mXPCOMThread = xpcomThread.forget().take();
    mXPCOMThread = xpcomThread.forget().take();
    nsCOMPtr<nsIThread> thread = NS_GetCurrentThread();


    lock.NotifyAll();
    lock.NotifyAll();


@@ -400,7 +401,6 @@ void CacheIOThread::ThreadFunc() {
        bool processedEvent;
        bool processedEvent;
        nsresult rv;
        nsresult rv;
        do {
        do {
          nsIThread* thread = mXPCOMThread;
          rv = thread->ProcessNextEvent(false, &processedEvent);
          rv = thread->ProcessNextEvent(false, &processedEvent);


          ++mEventCounter;
          ++mEventCounter;