Bug 1323100 - Use NS_NewNamedThread for the Wifi Monitor thread. r?froydnj draft
authorMarkus Stange <mstange@themasta.com>
Wed, 21 Dec 2016 11:33:21 +0100
changeset 456872 11afdcc39701c62088729ea0975325ecb2af7eab
parent 456871 a0e25a9f0ce024e53bc839491ab266800596d800
child 456873 5a1c5ae09ae0d43083b3e36956ff115915429c66
push id40636
push userbmo:mstange@themasta.com
push dateFri, 06 Jan 2017 12:38:48 +0000
reviewersfroydnj
bugs1323100
milestone53.0a1
Bug 1323100 - Use NS_NewNamedThread for the Wifi Monitor thread. r?froydnj MozReview-Commit-ID: 25lwf8WdANT
netwerk/wifi/nsWifiMonitor.cpp
--- a/netwerk/wifi/nsWifiMonitor.cpp
+++ b/netwerk/wifi/nsWifiMonitor.cpp
@@ -79,17 +79,17 @@ NS_IMETHODIMP nsWifiMonitor::StartWatchi
       // but if DoScan returns with an error before shutdown (i.e. !mKeepGoing)
       // then we will respawn the thread.
       LOG(("nsWifiMonitor::StartWatching %p restarting thread\n", this));
       mThreadComplete = false;
       mThread = nullptr;
   }
 
   if (!mThread) {
-    rv = NS_NewThread(getter_AddRefs(mThread), this);
+    rv = NS_NewNamedThread("Wifi Monitor", getter_AddRefs(mThread), this);
     if (NS_FAILED(rv))
       return rv;
   }
 
 
   mListeners.AppendElement(nsWifiListener(new nsMainThreadPtrHolder<nsIWifiListener>(aListener)));
 
   // tell ourselves that we have a new watcher.
@@ -150,18 +150,16 @@ NS_IMETHODIMP nsPassErrorToWifiListeners
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsWifiMonitor::Run()
 {
   LOG(("@@@@@ wifi monitor run called\n"));
 
-  PR_SetCurrentThreadName("Wifi Monitor");
-
   nsresult rv = DoScan();
   LOG(("@@@@@ wifi monitor run::doscan complete %x\n", rv));
 
   nsAutoPtr<WifiListenerArray> currentListeners;
   bool doError = false;
 
   {
       ReentrantMonitorAutoEnter mon(mReentrantMonitor);