Remove unnecessary allocation/deallocation from masterLock

* Add make_lock.
* Rename Application::LockType to Application::MutexType:
* Rename getMasterLock to getMasterMutex.
* Use getMasterMutex and make_lock.
* Remove unused code.
This commit is contained in:
Howard Hinnant
2015-03-18 12:29:40 -04:00
committed by Tom Ritchford
parent 698fe73608
commit a61ffab3f9
20 changed files with 85 additions and 41 deletions

View File

@@ -60,6 +60,7 @@
#include <beast/module/core/thread/DeadlineTimer.h>
#include <beast/module/core/system/SystemStats.h>
#include <beast/cxx14/memory.h> // <memory>
#include <beast/utility/make_lock.h>
#include <boost/optional.hpp>
#include <tuple>
@@ -652,7 +653,7 @@ void NetworkOPsImp::onDeadlineTimer (beast::DeadlineTimer& timer)
void NetworkOPsImp::processHeartbeatTimer ()
{
{
auto lock = getApp().masterLock();
auto lock = beast::make_lock(getApp().getMasterMutex());
// VFALCO NOTE This is for diagnosing a crash on exit
Application& app (getApp ());
@@ -1004,7 +1005,7 @@ Transaction::pointer NetworkOPsImp::processTransactionCb (
}
{
auto lock = getApp().masterLock();
auto lock = beast::make_lock(getApp().getMasterMutex());
bool didApply;
TER r = m_ledgerMaster.doTransaction (
@@ -1600,7 +1601,7 @@ void NetworkOPsImp::processTrustedProposal (
uint256 checkLedger, bool sigGood)
{
{
auto lock = getApp().masterLock();
auto lock = beast::make_lock(getApp().getMasterMutex());
bool relay = true;