mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-01 08:25:51 +00:00
Merge branch 'master' of github.com:jedmccaleb/NewCoin
This commit is contained in:
@@ -256,16 +256,18 @@ void JobQueue::threadEntry()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
std::set<Job>::iterator it = mJobSet.begin();
|
std::set<Job>::iterator it = mJobSet.begin();
|
||||||
Job job(*it);
|
{
|
||||||
mJobSet.erase(it);
|
Job job(*it);
|
||||||
--mJobCounts[job.getType()];
|
mJobSet.erase(it);
|
||||||
|
--mJobCounts[job.getType()];
|
||||||
|
|
||||||
if (job.getType() == jtDEATH)
|
if (job.getType() == jtDEATH)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
sl.unlock();
|
sl.unlock();
|
||||||
cLog(lsTRACE) << "Doing " << Job::toString(job.getType()) << " job";
|
cLog(lsTRACE) << "Doing " << Job::toString(job.getType()) << " job";
|
||||||
job.doJob();
|
job.doJob();
|
||||||
|
} // must destroy job without holding lock
|
||||||
sl.lock();
|
sl.lock();
|
||||||
}
|
}
|
||||||
--mThreadCount;
|
--mThreadCount;
|
||||||
|
|||||||
@@ -1696,12 +1696,14 @@ bool NetworkOPs::subLedger(InfoSub::ref isrListener, Json::Value& jvResult)
|
|||||||
jvResult["reserve_base"] = Json::UInt(lpClosed->getReserve(0));
|
jvResult["reserve_base"] = Json::UInt(lpClosed->getReserve(0));
|
||||||
jvResult["reserve_inc"] = Json::UInt(lpClosed->getReserveInc());
|
jvResult["reserve_inc"] = Json::UInt(lpClosed->getReserveInc());
|
||||||
|
|
||||||
|
boost::recursive_mutex::scoped_lock sl(mMonitorLock);
|
||||||
return mSubLedger.insert(std::make_pair(isrListener->getSeq(), isrListener)).second;
|
return mSubLedger.insert(std::make_pair(isrListener->getSeq(), isrListener)).second;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <-- bool: true=erased, false=was not there
|
// <-- bool: true=erased, false=was not there
|
||||||
bool NetworkOPs::unsubLedger(uint64 uSeq)
|
bool NetworkOPs::unsubLedger(uint64 uSeq)
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock sl(mMonitorLock);
|
||||||
return !!mSubLedger.erase(uSeq);
|
return !!mSubLedger.erase(uSeq);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1722,36 +1724,42 @@ bool NetworkOPs::subServer(InfoSub::ref isrListener, Json::Value& jvResult)
|
|||||||
jvResult["load_base"] = theApp->getFeeTrack().getLoadBase();
|
jvResult["load_base"] = theApp->getFeeTrack().getLoadBase();
|
||||||
jvResult["load_factor"] = theApp->getFeeTrack().getLoadFactor();
|
jvResult["load_factor"] = theApp->getFeeTrack().getLoadFactor();
|
||||||
|
|
||||||
|
boost::recursive_mutex::scoped_lock sl(mMonitorLock);
|
||||||
return mSubServer.insert(std::make_pair(isrListener->getSeq(), isrListener)).second;
|
return mSubServer.insert(std::make_pair(isrListener->getSeq(), isrListener)).second;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <-- bool: true=erased, false=was not there
|
// <-- bool: true=erased, false=was not there
|
||||||
bool NetworkOPs::unsubServer(uint64 uSeq)
|
bool NetworkOPs::unsubServer(uint64 uSeq)
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock sl(mMonitorLock);
|
||||||
return !!mSubServer.erase(uSeq);
|
return !!mSubServer.erase(uSeq);
|
||||||
}
|
}
|
||||||
|
|
||||||
// <-- bool: true=added, false=already there
|
// <-- bool: true=added, false=already there
|
||||||
bool NetworkOPs::subTransactions(InfoSub::ref isrListener)
|
bool NetworkOPs::subTransactions(InfoSub::ref isrListener)
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock sl(mMonitorLock);
|
||||||
return mSubTransactions.insert(std::make_pair(isrListener->getSeq(), isrListener)).second;
|
return mSubTransactions.insert(std::make_pair(isrListener->getSeq(), isrListener)).second;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <-- bool: true=erased, false=was not there
|
// <-- bool: true=erased, false=was not there
|
||||||
bool NetworkOPs::unsubTransactions(uint64 uSeq)
|
bool NetworkOPs::unsubTransactions(uint64 uSeq)
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock sl(mMonitorLock);
|
||||||
return !!mSubTransactions.erase(uSeq);
|
return !!mSubTransactions.erase(uSeq);
|
||||||
}
|
}
|
||||||
|
|
||||||
// <-- bool: true=added, false=already there
|
// <-- bool: true=added, false=already there
|
||||||
bool NetworkOPs::subRTTransactions(InfoSub::ref isrListener)
|
bool NetworkOPs::subRTTransactions(InfoSub::ref isrListener)
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock sl(mMonitorLock);
|
||||||
return mSubTransactions.insert(std::make_pair(isrListener->getSeq(), isrListener)).second;
|
return mSubTransactions.insert(std::make_pair(isrListener->getSeq(), isrListener)).second;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <-- bool: true=erased, false=was not there
|
// <-- bool: true=erased, false=was not there
|
||||||
bool NetworkOPs::unsubRTTransactions(uint64 uSeq)
|
bool NetworkOPs::unsubRTTransactions(uint64 uSeq)
|
||||||
{
|
{
|
||||||
|
boost::recursive_mutex::scoped_lock sl(mMonitorLock);
|
||||||
return !!mSubTransactions.erase(uSeq);
|
return !!mSubTransactions.erase(uSeq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user