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 454498 5f056e402d91fc26c78dc87afcf1d67edb3f9abd
parent 454497 338e33ecb320bbaea90912828a4a78ec0a2c01b8
child 454499 0b6629bc62980f7bafa618c16f5d24c110e6dd88
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 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()) {