Bug 1204837: Make ClosingService thread Nuwa-friedly. r=khuey
☠☠ backed out by 2b23ccfe78d8 ☠ ☠
authorCervantes Yu <cyu@mozilla.com>
Thu, 17 Sep 2015 14:36:06 +0800
changeset 295694 99c11d836978
parent 295693 bd9c944ed8ad
child 295695 15cc3c9efd9d
push id5245
push userraliiev@mozilla.com
push date2015-10-29 11:30 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1204837
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1204837: Make ClosingService thread Nuwa-friedly. r=khuey
netwerk/base/ClosingService.cpp
--- a/netwerk/base/ClosingService.cpp
+++ b/netwerk/base/ClosingService.cpp
@@ -1,16 +1,19 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set sw=2 ts=8 et tw=80 : */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ClosingService.h"
 #include "nsIOService.h"
+#ifdef MOZ_NUWA_PROCESS
+#include "ipc/Nuwa.h"
+#endif
 
 class ClosingLayerSecret
 {
 public:
   explicit ClosingLayerSecret(mozilla::net::ClosingService *aClosingService)
     : mClosingService(aClosingService)
   {
   }
@@ -195,16 +198,23 @@ ClosingService::ShutdownInternal()
     PR_JoinThread(mThread);
     mThread = nullptr;
   }
 }
 
 void
 ClosingService::ThreadFunc()
 {
+  PR_SetCurrentThreadName("Closing Service");
+#ifdef MOZ_NUWA_PROCESS
+  if (IsNuwaProcess()) {
+    NuwaMarkCurrentThread(nullptr, nullptr);
+  }
+#endif
+
   for (;;) {
     PRFileDesc *fd;
     {
       mozilla::MonitorAutoLock mon(mMonitor);
       while (!mShutdown && (mQueue.Length() == 0)) {
         mon.Wait();
       }