Bug 1462784 - Annotate idle stacks in nsThreadPool. r?froydnj
MozReview-Commit-ID: GtHBHQiXpf3
--- a/xpcom/threads/nsThreadPool.cpp
+++ b/xpcom/threads/nsThreadPool.cpp
@@ -208,16 +208,18 @@ nsThreadPool::Run()
}
if (exitThread) {
if (wasIdle) {
--mIdleCount;
}
shutdownThreadOnExit = mThreads.RemoveObject(current);
} else {
+ AUTO_PROFILER_LABEL("nsThreadPool::Run::Wait", IDLE);
+
TimeDuration delta = timeout - (now - idleSince);
LOG(("THRD-P(%p) %s waiting [%f]\n", this, mName.BeginReading(),
delta.ToMilliseconds()));
mEventsAvailable.Wait(delta);
LOG(("THRD-P(%p) done waiting\n", this));
}
} else if (wasIdle) {
wasIdle = false;