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 454495 39aa3611860557d818e2f047851ee680af98cda8
parent 454494 cdbbac865746149fd18ccf8693cd5316c6ba4529
child 454496 71e4c22affcc6fc988d118bae2c9f169ef27a8c8
push id39953
push userbmo:mstange@themasta.com
push dateThu, 29 Dec 2016 16:14:16 +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.