From f222544048b7bd9b70ada61e0300e9a02338e265 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Fri, 15 Mar 2013 22:50:26 -0700 Subject: [PATCH] Do the same thing for timer entry. --- src/cpp/ripple/LedgerAcquire.cpp | 7 ++++++- src/cpp/ripple/LedgerAcquire.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cpp/ripple/LedgerAcquire.cpp b/src/cpp/ripple/LedgerAcquire.cpp index 0dc34887e9..7db1a20afe 100644 --- a/src/cpp/ripple/LedgerAcquire.cpp +++ b/src/cpp/ripple/LedgerAcquire.cpp @@ -48,6 +48,7 @@ void PeerSet::setTimer() void PeerSet::invokeOnTimer() { + boost::recursive_mutex::scoped_lock sl(mLock); if (isDone()) return; @@ -71,8 +72,12 @@ void PeerSet::TimerEntry(boost::weak_ptr wptr, const boost::system::err { if (result == boost::asio::error::operation_aborted) return; + theApp->getJobQueue().addJob(jtLEDGER_DATA, "timerEntry", + boost::bind(&PeerSet::TimerJobEntry, _1, wptr)); +} - ScopedLock sl(theApp->getMasterLock()); +void PeerSet::TimerJobEntry(Job&, boost::weak_ptr wptr) +{ boost::shared_ptr ptr = wptr.lock(); if (ptr) ptr->invokeOnTimer(); diff --git a/src/cpp/ripple/LedgerAcquire.h b/src/cpp/ripple/LedgerAcquire.h index 78ab42994d..cb38f797f2 100644 --- a/src/cpp/ripple/LedgerAcquire.h +++ b/src/cpp/ripple/LedgerAcquire.h @@ -75,6 +75,7 @@ protected: private: static void TimerEntry(boost::weak_ptr, const boost::system::error_code& result); + static void TimerJobEntry(Job&, boost::weak_ptr); }; class LedgerAcquire :