Bug 1323100 - Always register named threads with the profiler. draft
authorMarkus Stange <mstange@themasta.com>
Mon, 12 Dec 2016 23:47:54 -0500
changeset 448854 ef769939a8deba53cb4d0e1e883a10a3c3366efe
parent 448853 a5b5461e3ee0b4e286f7d7881fffaf624864f4d3
child 539394 a1190b89bb7e7ec5ee0868418b2263e16ecf789d
push id38456
push userbmo:mstange@themasta.com
push dateTue, 13 Dec 2016 05:18:34 +0000
bugs1323100
milestone53.0a1
Bug 1323100 - Always register named threads with the profiler. MozReview-Commit-ID: I3N1S3Gz6NP
xpcom/glue/nsThreadUtils.cpp
--- a/xpcom/glue/nsThreadUtils.cpp
+++ b/xpcom/glue/nsThreadUtils.cpp
@@ -401,16 +401,20 @@ protected:
 };
 
 NS_IMPL_ISUPPORTS(InitNamedThreadRunnable, nsIRunnable)
 
 NS_IMETHODIMP
 InitNamedThreadRunnable::Run()
 {
   PR_SetCurrentThreadName(mName.BeginReading());
+
+  char stackBaseGuess;
+  profiler_register_thread(mName.BeginReading(), &stackBaseGuess);
+
   return NS_OK;
 }
 
 } // namespace
 
 #endif // !XPCOM_GLUE_AVOID_NSPR
 
 nsresult