Make some locks more granular:

- Overlay
- Cluster
- Validator List
- Consensus

The overlay also has its own lock and manages its own thread safety.
This commit is contained in:
JoelKatz
2019-04-18 11:47:45 -07:00
committed by Manoj doshi
parent adc1b8a36b
commit 5f908ba870
4 changed files with 2 additions and 9 deletions

View File

@@ -36,7 +36,6 @@ namespace ripple {
// XXX Might allow domain for manual connections.
Json::Value doConnect (RPC::Context& context)
{
auto lock = make_lock(context.app.getMasterMutex());
if (context.app.config().standalone())
return "cannot connect in standalone mode";

View File

@@ -30,10 +30,7 @@ Json::Value doConsensusInfo (RPC::Context& context)
{
Json::Value ret (Json::objectValue);
{
auto lock = make_lock(context.app.getMasterMutex());
ret[jss::info] = context.netOps.getConsensusInfo ();
}
ret[jss::info] = context.netOps.getConsensusInfo ();
return ret;
}

View File

@@ -33,8 +33,6 @@ Json::Value doPeers (RPC::Context& context)
Json::Value jvResult (Json::objectValue);
{
auto lock = make_lock(context.app.getMasterMutex());
jvResult[jss::peers] = context.app.overlay ().json ();
auto const now = context.app.timeKeeper().now();

View File

@@ -27,7 +27,6 @@ namespace ripple {
Json::Value doUnlList (RPC::Context& context)
{
auto lock = make_lock(context.app.getMasterMutex());
Json::Value obj (Json::objectValue);
context.app.validators().for_each_listed (
@@ -41,7 +40,7 @@ Json::Value doUnlList (RPC::Context& context)
TokenType::NodePublic, publicKey);
node[jss::trusted] = trusted;
unl.append (node);
unl.append (std::move (node));
});
return obj;