diff --git a/src/ripple_app/main/Application.cpp b/src/ripple_app/main/Application.cpp index e696ac8f14..0d2e2f3247 100644 --- a/src/ripple_app/main/Application.cpp +++ b/src/ripple_app/main/Application.cpp @@ -464,7 +464,7 @@ public: mSweepTimer.expires_from_now (boost::posix_time::seconds (10)); mSweepTimer.async_wait (BIND_TYPE (&ApplicationImp::sweep, this)); - m_loadManager->startThread (); + m_loadManager->start (); #if ! BEAST_WIN32 #ifdef SIGINT diff --git a/src/ripple_app/main/LoadManager.cpp b/src/ripple_app/main/LoadManager.cpp index 56ed18181d..dc2a9ee184 100644 --- a/src/ripple_app/main/LoadManager.cpp +++ b/src/ripple_app/main/LoadManager.cpp @@ -10,7 +10,7 @@ SETUP_LOG (LoadManager) class LoadManagerImp : public LoadManager - , public beast::InterruptibleThread::EntryPoint + , public Thread { private: /* Entry mapping utilization to cost. @@ -60,8 +60,8 @@ private: public: LoadManagerImp () - : mLock (this, "LoadManagerImp", __FILE__, __LINE__) - , m_thread ("loadmgr") + : Thread ("loadmgr") + , mLock (this, "LoadManagerImp", __FILE__, __LINE__) , m_logThread ("loadmgr_log") , mCreditRate (100) , mCreditLimit (500) @@ -119,12 +119,12 @@ private: { UptimeTimer::getInstance ().endManualUpdates (); - m_thread.interrupt (); + stopThread (); } - void startThread () + void start () { - m_thread.start (this); + startThread(); } void canonicalize (LoadSource& source, int now) const @@ -324,14 +324,14 @@ private: // VFALCO NOTE Where's the thread object? It's not a data member... // - void threadRun () + void run () { // VFALCO TODO replace this with a beast Time object? // // Initialize the clock to the current time. boost::posix_time::ptime t = boost::posix_time::microsec_clock::universal_time (); - while (! m_thread.interruptionPoint ()) + while (! threadShouldExit ()) { { // VFALCO NOTE What is this lock protecting? @@ -413,7 +413,6 @@ private: typedef LockType::ScopedLockType ScopedLockType; LockType mLock; - beast::InterruptibleThread m_thread; beast::ThreadWithCallQueue m_logThread; int mCreditRate; // credits gained/lost per second diff --git a/src/ripple_app/main/LoadManager.h b/src/ripple_app/main/LoadManager.h index 33b5707578..1a797ff99c 100644 --- a/src/ripple_app/main/LoadManager.h +++ b/src/ripple_app/main/LoadManager.h @@ -45,7 +45,7 @@ public: */ // VFALCO TODO Simplify the two stage initialization to one stage (construction). // NOTE In stand-alone mode the load manager thread isn't started - virtual void startThread () = 0; + virtual void start () = 0; /** Turn on deadlock detection.