Bug 1323100 - Use NS_NewNamedThread for the Filewatcher IO thread. r?froydnj
MozReview-Commit-ID: 18qfXNx8BtJ
--- 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.