mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Don't spin when an IO+ thread returns to the job queue.
This commit is contained in:
@@ -291,12 +291,19 @@ void JobQueue::threadEntry()
|
|||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
NameThread("waiting");
|
NameThread("waiting");
|
||||||
|
bool didIO = false;
|
||||||
while (mJobSet.empty() && !mShuttingDown)
|
while (mJobSet.empty() && !mShuttingDown)
|
||||||
{
|
{
|
||||||
if ((mIOThreadCount < mMaxIOThreadCount) && !theApp->isShutdown())
|
if ((mIOThreadCount < mMaxIOThreadCount) && !didIO && !theApp->isShutdown())
|
||||||
|
{
|
||||||
IOThread(sl);
|
IOThread(sl);
|
||||||
|
didIO = true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
mJobCond.wait(sl);
|
mJobCond.wait(sl);
|
||||||
|
didIO = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mShuttingDown)
|
if (mShuttingDown)
|
||||||
|
|||||||
Reference in New Issue
Block a user