Bug 1323100 - Use NS_NewNamedThread for CryptoTask threads. r?froydnj draft
authorMarkus Stange <mstange@themasta.com>
Tue, 20 Dec 2016 14:27:18 +0100
changeset 456876 27082a5571f2f8e2444d2d518eaf7748f2ebeaa6
parent 456875 591fba4a8a1803f4449a2c32dc4b9c8c5c3ca2e4
child 456877 6e6a9d539ce92d734bf8442ab24683c263b6d1a2
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 CryptoTask threads. r?froydnj MozReview-Commit-ID: 6c6iDuGyE2X
security/manager/ssl/CryptoTask.cpp
--- a/security/manager/ssl/CryptoTask.cpp
+++ b/security/manager/ssl/CryptoTask.cpp
@@ -26,23 +26,23 @@ CryptoTask::Dispatch(const nsACString& t
 
   // Ensure that NSS is initialized, since presumably CalculateResult
   // will use NSS functions
   if (!EnsureNSSInitializedChromeOrContent()) {
     return NS_ERROR_FAILURE;
   }
 
   // Can't add 'this' as the event to run, since mThread may not be set yet
-  nsresult rv = NS_NewThread(getter_AddRefs(mThread), nullptr,
-                             nsIThreadManager::DEFAULT_STACK_SIZE);
+  nsresult rv = NS_NewNamedThread(taskThreadName, getter_AddRefs(mThread),
+                                  nullptr,
+                                  nsIThreadManager::DEFAULT_STACK_SIZE);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
-  NS_SetThreadName(mThread, taskThreadName);
   // Note: event must not null out mThread!
   return mThread->Dispatch(this, NS_DISPATCH_NORMAL);
 }
 
 NS_IMETHODIMP
 CryptoTask::Run()
 {
   if (!NS_IsMainThread()) {