Don't spin when an IO+ thread returns to the job queue.

This commit is contained in:
JoelKatz
2013-03-29 17:07:42 -07:00
parent 1de7ef2058
commit 75dd924f3a

View File

@@ -291,12 +291,19 @@ void JobQueue::threadEntry()
while (1)
{
NameThread("waiting");
bool didIO = false;
while (mJobSet.empty() && !mShuttingDown)
{
if ((mIOThreadCount < mMaxIOThreadCount) && !theApp->isShutdown())
if ((mIOThreadCount < mMaxIOThreadCount) && !didIO && !theApp->isShutdown())
{
IOThread(sl);
didIO = true;
}
else
{
mJobCond.wait(sl);
didIO = false;
}
}
if (mShuttingDown)