Make debug easier by naming threads.

This commit is contained in:
JoelKatz
2013-03-20 05:41:08 -07:00
parent f3400d88fc
commit 9ceb380cb8
6 changed files with 50 additions and 2 deletions

View File

@@ -266,6 +266,7 @@ void JobQueue::threadEntry()
boost::mutex::scoped_lock sl(mJobLock);
while (1)
{
NameThread("waiting");
while (mJobSet.empty() && !mShuttingDown)
mJobCond.wait(sl);
@@ -286,6 +287,7 @@ void JobQueue::threadEntry()
++(mJobCounts[type].second);
sl.unlock();
NameThread(Job::toString(type));
cLog(lsTRACE) << "Doing " << Job::toString(type) << " job";
job.doJob();
} // must destroy job without holding lock