Commit df85da14 authored by Jens Stutte's avatar Jens Stutte
Browse files

Bug 1740899: Make nsThreadPool::Shutdown(WithTimeout) return an error on...

Bug 1740899: Make nsThreadPool::Shutdown(WithTimeout) return an error on re-entrance. r=xpcom-reviewers,nika

Differential Revision: https://phabricator.services.mozilla.com/D131589
parent e95d8cf1
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -386,6 +386,9 @@ nsThreadPool::Shutdown() {
  nsCOMPtr<nsIThreadPoolListener> listener;
  {
    MutexAutoLock lock(mMutex);
    if (mShutdown) {
      return NS_ERROR_ILLEGAL_DURING_SHUTDOWN;
    }
    mShutdown = true;
    mEventsAvailable.NotifyAll();

@@ -437,6 +440,9 @@ nsThreadPool::ShutdownWithTimeout(int32_t aTimeoutMs) {
  nsCOMPtr<nsIThreadPoolListener> listener;
  {
    MutexAutoLock lock(mMutex);
    if (mShutdown) {
      return NS_ERROR_ILLEGAL_DURING_SHUTDOWN;
    }
    mShutdown = true;
    mEventsAvailable.NotifyAll();