Bug 1342774 - Fix the deadlock caused by TaskTracer. r=cervantes
authorThinker K.F. Li <thinker@codemud.net>
Wed, 01 Mar 2017 00:57:00 -0500
changeset 345329 acf42887c8a7cf23ff677d49742cd6610545a38b
parent 345328 5ef0e255799d58592fbb7f70636cbb91c8b90c6a
child 345330 1bea491fae965da7d65cf345f67ca5fb870d4356
push id31436
push userkwierso@gmail.com
push dateThu, 02 Mar 2017 01:18:52 +0000
treeherdermozilla-central@e91de6fb2b3d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscervantes
bugs1342774
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1342774 - Fix the deadlock caused by TaskTracer. r=cervantes
tools/profiler/tasktracer/TracedTaskCommon.cpp
--- a/tools/profiler/tasktracer/TracedTaskCommon.cpp
+++ b/tools/profiler/tasktracer/TracedTaskCommon.cpp
@@ -29,20 +29,24 @@ TracedTaskCommon::TracedTaskCommon()
 
 TracedTaskCommon::~TracedTaskCommon()
 {
 }
 
 void
 TracedTaskCommon::Init()
 {
+  // Keep the following line before GetOrCreateTraceInfo() to avoid a
+  // deadlock.
+  uint64_t taskid = GenNewUniqueTaskId();
+
   TraceInfoHolder info = GetOrCreateTraceInfo();
   ENSURE_TRUE_VOID(info);
 
-  mTaskId = GenNewUniqueTaskId();
+  mTaskId = taskid;
   mSourceEventId = info->mCurTraceSourceId;
   mSourceEventType = info->mCurTraceSourceType;
   mParentTaskId = info->mCurTaskId;
   mIsTraceInfoInit = true;
 }
 
 void
 TracedTaskCommon::DispatchTask(int aDelayTimeMs)