Bug 1376858 - Use SystemGroup to label nsIThread::AsyncShutdown, r=billm draft
authorSean V Kelley <seanvk@oregontracks.org>
Sun, 27 Aug 2017 18:58:54 -0700
changeset 653790 c6c47ba59dc983ba0747f4a222a88e9fbac3efb2
parent 653695 2f0b519d13e9dd945b37b235db1981d5ffb2199f
child 728414 5da35c659c1aa0b82074d2ce9dad1449c313a38c
push id76408
push userbmo:seanvk@oregontracks.org
push dateMon, 28 Aug 2017 02:16:35 +0000
Bug 1376858 - Use SystemGroup to label nsIThread::AsyncShutdown, r=billm MozReview-Commit-ID: IDPE6zhEnVI
--- a/xpcom/threads/nsThreadPool.cpp
+++ b/xpcom/threads/nsThreadPool.cpp
@@ -141,18 +141,18 @@ nsThreadPool::ShutdownThread(nsIThread* 
   // such a way that the newly created thread is no longer necessary.
   // In the first case, we must go to another thread to shut aThread down
   // (because it is the current thread).  In the second case, we cannot
   // synchronously shut down the current thread (because then Dispatch() would
   // spin the event loop, and that could blow up the world), and asynchronous
   // shutdown requires this thread have an event loop (and it may not, see bug
   // 10204784).  The simplest way to cover all cases is to asynchronously
   // shutdown aThread from the main thread.
-  NS_DispatchToMainThread(NewRunnableMethod("nsIThread::AsyncShutdown", aThread,
-                                            &nsIThread::AsyncShutdown));
+  SystemGroup::Dispatch(TaskCategory::Other, NewRunnableMethod(
+        "nsIThread::AsyncShutdown", aThread, &nsIThread::AsyncShutdown));
   LOG(("THRD-P(%p) enter %s\n", this, mName.BeginReading()));
   nsCOMPtr<nsIThread> current;