Bug 1323100 - Use NS_NewNamedThread for the Filewatcher IO thread. r?froydnj draft
authorMarkus Stange <mstange@themasta.com>
Wed, 21 Dec 2016 11:34:36 +0100
changeset 456873 5a1c5ae09ae0d43083b3e36956ff115915429c66
parent 456872 11afdcc39701c62088729ea0975325ecb2af7eab
child 456874 f0f368530cff86959cfc59c3f6a9ea59236b823e
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 Filewatcher IO thread. r?froydnj MozReview-Commit-ID: 18qfXNx8BtJ
toolkit/components/filewatcher/NativeFileWatcherWin.cpp
--- a/toolkit/components/filewatcher/NativeFileWatcherWin.cpp
+++ b/toolkit/components/filewatcher/NativeFileWatcherWin.cpp
@@ -1248,27 +1248,25 @@ NativeFileWatcherService::Init()
   if (!observerService) {
     return NS_ERROR_FAILURE;
   }
 
   observerService->AddObserver(this, "xpcom-shutdown-threads", false);
 
   // Start the IO worker thread.
   mWorkerIORunnable = new NativeFileWatcherIOTask(completionPort);
-  nsresult rv = NS_NewThread(getter_AddRefs(mIOThread), mWorkerIORunnable);
+  nsresult rv = NS_NewNamedThread("FileWatcher IO", getter_AddRefs(mIOThread),
+                                  mWorkerIORunnable);
   if (NS_FAILED(rv)) {
     FILEWATCHERLOG(
       "NativeFileWatcherIOTask::Init - Unable to create and dispatch the worker thread (%x).",
       rv);
     return rv;
   }
 
-  // Set the name for the worker thread.
-  NS_SetThreadName(mIOThread, "FileWatcher IO");
-
   mIOCompletionPort = completionPort.forget();
 
   return NS_OK;
 }
 
 /**
  * Watches a path for changes: monitors the creations, name changes and
  * content changes to the files contained in the watched path.