Add ripple_main module

This commit is contained in:
Vinnie Falco
2013-05-22 16:17:13 -07:00
parent cee678f849
commit a5360379ac
12 changed files with 262 additions and 130 deletions

View File

@@ -8,8 +8,6 @@
#include "Config.h"
#include "Application.h"
SETUP_LOG();
JobQueue::JobQueue(boost::asio::io_service& svc)
: mLastJob(0), mThreadCount(0), mShuttingDown(false), mIOThreadCount(0), mMaxIOThreadCount(1), mIOService(svc)
{
@@ -222,7 +220,7 @@ int JobQueue::isOverloaded()
void JobQueue::shutdown()
{ // shut down the job queue without completing pending jobs
cLog(lsINFO) << "Job queue shutting down";
WriteLog (lsINFO, JobQueue) << "Job queue shutting down";
boost::mutex::scoped_lock sl(mJobLock);
mShuttingDown = true;
mJobCond.notify_all();
@@ -242,7 +240,7 @@ void JobQueue::setThreadCount(int c)
if (c > 4) // I/O will bottleneck
c = 4;
c += 2;
cLog(lsINFO) << "Auto-tuning to " << c << " validation/transaction/proposal threads";
WriteLog (lsINFO, JobQueue) << "Auto-tuning to " << c << " validation/transaction/proposal threads";
}
boost::mutex::scoped_lock sl(mJobLock);
@@ -281,7 +279,7 @@ void JobQueue::IOThread(boost::mutex::scoped_lock& sl)
}
catch (...)
{
cLog(lsWARNING) << "Exception in IOThread";
WriteLog (lsWARNING, JobQueue) << "Exception in IOThread";
}
NameThread("waiting");
sl.lock();
@@ -327,7 +325,7 @@ void JobQueue::threadEntry()
++(mJobCounts[type].second);
sl.unlock();
NameThread(Job::toString(type));
cLog(lsTRACE) << "Doing " << Job::toString(type) << " job";
WriteLog (lsTRACE, JobQueue) << "Doing " << Job::toString(type) << " job";
job.doJob();
} // must destroy job without holding lock
sl.lock();