diff --git a/src/beast/modules/beast_core/thread/Stoppable.cpp b/src/beast/modules/beast_core/thread/Stoppable.cpp index bdb866c84a..fc6f57cdfc 100644 --- a/src/beast/modules/beast_core/thread/Stoppable.cpp +++ b/src/beast/modules/beast_core/thread/Stoppable.cpp @@ -65,47 +65,47 @@ void Stoppable::stopped () m_stoppedEvent.signal(); } -void Stoppable::onPrepare (Journal journal) +void Stoppable::onPrepare () { } -void Stoppable::onStart (Journal journal) +void Stoppable::onStart () { } -void Stoppable::onStop (Journal journal) +void Stoppable::onStop () { stopped(); } -void Stoppable::onChildrenStopped (Journal journal) +void Stoppable::onChildrenStopped () { } //------------------------------------------------------------------------------ -void Stoppable::prepareRecursive (Journal journal) +void Stoppable::prepareRecursive () { - onPrepare (journal); for (Children::const_iterator iter (m_children.cbegin ()); iter != m_children.cend(); ++iter) - iter->stoppable->prepareRecursive (journal); + iter->stoppable->prepareRecursive (); + onPrepare (); } -void Stoppable::startRecursive (Journal journal) +void Stoppable::startRecursive () { - onStart (journal); + onStart (); for (Children::const_iterator iter (m_children.cbegin ()); iter != m_children.cend(); ++iter) - iter->stoppable->startRecursive (journal); + iter->stoppable->startRecursive (); } -void Stoppable::stopAsyncRecursive (Journal journal) +void Stoppable::stopAsyncRecursive () { - onStop (journal); + onStop (); for (Children::const_iterator iter (m_children.cbegin ()); iter != m_children.cend(); ++iter) - iter->stoppable->stopAsyncRecursive (journal); + iter->stoppable->stopAsyncRecursive (); } void Stoppable::stopRecursive (Journal journal) @@ -120,7 +120,7 @@ void Stoppable::stopRecursive (Journal journal) // memoryBarrier (); m_childrenStopped = true; - onChildrenStopped (journal); + onChildrenStopped (); // Now block on this Stoppable. // @@ -151,30 +151,24 @@ bool RootStoppable::isStopping() const return m_calledStopAsync.get() != 0; } -void RootStoppable::prepare (Journal journal) +void RootStoppable::prepare () { if (! m_prepared.compareAndSetBool (1, 0)) - { - journal.warning << "Stoppable::prepare called again"; return; - } - prepareRecursive (journal); + prepareRecursive (); } -void RootStoppable::start (Journal journal) +void RootStoppable::start () { // Courtesy call to prepare. if (m_prepared.compareAndSetBool (1, 0)) - prepareRecursive (journal); + prepareRecursive (); if (! m_started.compareAndSetBool (1, 0)) - { - journal.warning << "Stoppable::start called again"; return; - } - startRecursive (journal); + startRecursive (); } void RootStoppable::stop (Journal journal) @@ -185,14 +179,14 @@ void RootStoppable::stop (Journal journal) return; } - stopAsync (journal); + stopAsync (); stopRecursive (journal); } -void RootStoppable::stopAsync (Journal journal) +void RootStoppable::stopAsync () { if (! m_calledStopAsync.compareAndSetBool (1, 0)) return; - stopAsyncRecursive (journal); + stopAsyncRecursive (); } diff --git a/src/beast/modules/beast_core/thread/Stoppable.h b/src/beast/modules/beast_core/thread/Stoppable.h index f7f96d982c..c556df5d4e 100644 --- a/src/beast/modules/beast_core/thread/Stoppable.h +++ b/src/beast/modules/beast_core/thread/Stoppable.h @@ -185,10 +185,10 @@ public: The default implementation does nothing. Guaranteed to only be called once. */ - virtual void onPrepare (Journal journal); + virtual void onPrepare (); /** Override called during start. */ - virtual void onStart (Journal journal); + virtual void onStart (); /** Override called when the stop notification is issued. @@ -211,7 +211,7 @@ public: Guaranteed only to be called once. Must be safe to call from any thread at any time. */ - virtual void onStop (Journal journal); + virtual void onStop (); /** Override called when all children have stopped. @@ -231,7 +231,7 @@ public: Guaranteed only to be called once. Must be safe to call from any thread at any time. */ - virtual void onChildrenStopped (Journal journal); + virtual void onChildrenStopped (); private: friend class RootStoppable; @@ -248,9 +248,9 @@ private: Stoppable* stoppable; }; - void prepareRecursive (Journal journal); - void startRecursive (Journal journal); - void stopAsyncRecursive (Journal journal); + void prepareRecursive (); + void startRecursive (); + void stopAsyncRecursive (); void stopRecursive (Journal journal); protected: @@ -280,7 +280,7 @@ public: Thread safety: May be called from any thread. */ - void prepare (Journal journal = Journal()); + void prepare (); /** Start all contained Stoppable objects. The default implementation does nothing. @@ -288,7 +288,7 @@ public: Thread safety: May be called from any thread. */ - void start (Journal journal = Journal()); + void start (); /** Notify a root stoppable and children to stop, and block until stopped. Has no effect if the stoppable was already notified. @@ -304,7 +304,7 @@ public: Thread safety: Safe to call from any thread at any time. */ - void stopAsync (Journal journal = Journal()); + void stopAsync (); private: Atomic m_prepared; diff --git a/src/ripple/peerfinder/impl/Manager.cpp b/src/ripple/peerfinder/impl/Manager.cpp index f9c31d9563..cde464e265 100644 --- a/src/ripple/peerfinder/impl/Manager.cpp +++ b/src/ripple/peerfinder/impl/Manager.cpp @@ -270,16 +270,16 @@ public: // Stoppable // - void onPrepare (Journal journal) + void onPrepare () { } - void onStart (Journal journal) + void onStart () { startThread(); } - void onStop (Journal journal) + void onStop () { if (this->Thread::isThreadRunning ()) { diff --git a/src/ripple/validators/impl/Manager.cpp b/src/ripple/validators/impl/Manager.cpp index 24f202ef5f..b4c3571bb3 100644 --- a/src/ripple/validators/impl/Manager.cpp +++ b/src/ripple/validators/impl/Manager.cpp @@ -255,19 +255,19 @@ public: // Stoppable // - void onPrepare (Journal journal) + void onPrepare () { #if RIPPLE_USE_NEW_VALIDATORS - journal.info << "Validators preparing"; + m_journal.info << "Validators preparing"; addRPCHandlers(); #endif } - void onStart (Journal journal) + void onStart () { #if RIPPLE_USE_NEW_VALIDATORS - journal.info << "Validators starting"; + m_journal.info << "Validators starting"; // Do this late so the sources have a chance to be added. m_queue.dispatch (bind (&ManagerImp::setCheckSources, this)); @@ -276,9 +276,9 @@ public: #endif } - void onStop (Journal journal) + void onStop () { - journal.info << "Validators stopping"; + m_journal.info << "Validators stopping"; if (this->Thread::isThreadRunning()) { diff --git a/src/ripple_app/ledger/InboundLedgers.cpp b/src/ripple_app/ledger/InboundLedgers.cpp index 84a2b2c658..452815d570 100644 --- a/src/ripple_app/ledger/InboundLedgers.cpp +++ b/src/ripple_app/ledger/InboundLedgers.cpp @@ -351,7 +351,7 @@ Json::Value InboundLedgers::getInfo() return ret; } -void InboundLedgers::onStop (Journal) +void InboundLedgers::onStop () { ScopedLockType lock (mLock, __FILE__, __LINE__); diff --git a/src/ripple_app/ledger/InboundLedgers.h b/src/ripple_app/ledger/InboundLedgers.h index 79661f08bb..d8151227dc 100644 --- a/src/ripple_app/ledger/InboundLedgers.h +++ b/src/ripple_app/ledger/InboundLedgers.h @@ -76,7 +76,7 @@ public: void gotFetchPack (Job&); void sweep (); - void onStop (Journal); + void onStop (); private: typedef boost::unordered_map MapType; diff --git a/src/ripple_app/main/Application.cpp b/src/ripple_app/main/Application.cpp index 04a574af40..837ec77f97 100644 --- a/src/ripple_app/main/Application.cpp +++ b/src/ripple_app/main/Application.cpp @@ -641,22 +641,22 @@ public: // Stoppable // - void onPrepare (Journal) + void onPrepare () { prepareValidators (); } - void onStart (Journal journal) + void onStart () { - journal.debug << "Application starting"; + m_journal.debug << "Application starting"; m_sweepTimer.setExpiration (10); } // Called to indicate shutdown. - void onStop (Journal journal) + void onStop () { - journal.debug << "Application stopping"; + m_journal.debug << "Application stopping"; m_sweepTimer.cancel(); @@ -679,8 +679,8 @@ public: // crash), the run() function will not get called and we will // avoid doing silly things like contacting the SNTP server, or // running the various logic threads like Validators, PeerFinder, etc. - prepare (m_journal); - start (m_journal); + prepare (); + start (); { diff --git a/src/ripple_app/main/IoServicePool.cpp b/src/ripple_app/main/IoServicePool.cpp index 410886aa27..6f04e7f638 100644 --- a/src/ripple_app/main/IoServicePool.cpp +++ b/src/ripple_app/main/IoServicePool.cpp @@ -90,7 +90,7 @@ IoServicePool::operator boost::asio::io_service& () return m_service; } -void IoServicePool::onStop (Journal) +void IoServicePool::onStop () { // VFALCO NOTE This is a hack! We should gracefully // cancel all pending I/O, and delete the work @@ -100,7 +100,7 @@ void IoServicePool::onStop (Journal) m_service.stop (); } -void IoServicePool::onChildrenStopped (Journal) +void IoServicePool::onChildrenStopped () { } diff --git a/src/ripple_app/main/IoServicePool.h b/src/ripple_app/main/IoServicePool.h index 7621e4f228..ad2cdc7f9c 100644 --- a/src/ripple_app/main/IoServicePool.h +++ b/src/ripple_app/main/IoServicePool.h @@ -31,8 +31,8 @@ public: boost::asio::io_service& getService (); operator boost::asio::io_service& (); - void onStop (Journal); - void onChildrenStopped (Journal); + void onStop (); + void onChildrenStopped (); private: class ServiceThread; diff --git a/src/ripple_app/main/LoadManager.cpp b/src/ripple_app/main/LoadManager.cpp index 4a1fd5e99d..a3f4202f59 100644 --- a/src/ripple_app/main/LoadManager.cpp +++ b/src/ripple_app/main/LoadManager.cpp @@ -155,21 +155,21 @@ public: // Stoppable // - void onPrepare (Journal) + void onPrepare () { } - void onStart (Journal journal) + void onStart () { - journal.debug << "Starting"; + m_journal.debug << "Starting"; startThread (); } - void onStop (Journal journal) + void onStop () { if (isThreadRunning ()) { - journal.debug << "Stopping"; + m_journal.debug << "Stopping"; stopThreadAsync (); } else diff --git a/src/ripple_app/main/NodeStoreScheduler.cpp b/src/ripple_app/main/NodeStoreScheduler.cpp index 4c47092944..b718823043 100644 --- a/src/ripple_app/main/NodeStoreScheduler.cpp +++ b/src/ripple_app/main/NodeStoreScheduler.cpp @@ -25,13 +25,13 @@ NodeStoreScheduler::NodeStoreScheduler (Stoppable& parent, JobQueue& jobQueue) { } -void NodeStoreScheduler::onStop (Journal) +void NodeStoreScheduler::onStop () { if (--m_taskCount == 0) stopped(); } -void NodeStoreScheduler::onChildrenStopped (Journal) +void NodeStoreScheduler::onChildrenStopped () { } diff --git a/src/ripple_app/main/NodeStoreScheduler.h b/src/ripple_app/main/NodeStoreScheduler.h index 1f888438af..fe44c410b9 100644 --- a/src/ripple_app/main/NodeStoreScheduler.h +++ b/src/ripple_app/main/NodeStoreScheduler.h @@ -29,8 +29,8 @@ class NodeStoreScheduler public: NodeStoreScheduler (Stoppable& parent, JobQueue& jobQueue); - void onStop (Journal); - void onChildrenStopped (Journal); + void onStop (); + void onChildrenStopped (); void scheduleTask (NodeStore::Task& task); private: diff --git a/src/ripple_app/main/RPCHTTPServer.cpp b/src/ripple_app/main/RPCHTTPServer.cpp index 55049add19..626852a3cc 100644 --- a/src/ripple_app/main/RPCHTTPServer.cpp +++ b/src/ripple_app/main/RPCHTTPServer.cpp @@ -92,12 +92,12 @@ public: // Stoppable // - void onStop (Journal) + void onStop () { m_server.stopAsync(); } - void onChildrenStopped (Journal) + void onChildrenStopped () { } diff --git a/src/ripple_app/misc/NetworkOPs.cpp b/src/ripple_app/misc/NetworkOPs.cpp index 4598bdbed8..ffcdf9bb92 100644 --- a/src/ripple_app/misc/NetworkOPs.cpp +++ b/src/ripple_app/misc/NetworkOPs.cpp @@ -376,7 +376,7 @@ public: // // Stoppable - void onStop (Journal) + void onStop () { m_heartbeatTimer.cancel(); m_clusterTimer.cancel(); diff --git a/src/ripple_app/peers/PeerDoor.cpp b/src/ripple_app/peers/PeerDoor.cpp index aa9b06ced5..85502ae8d5 100644 --- a/src/ripple_app/peers/PeerDoor.cpp +++ b/src/ripple_app/peers/PeerDoor.cpp @@ -107,7 +107,7 @@ public: //-------------------------------------------------------------------------- - void onStop (Journal) + void onStop () { { boost::system::error_code ec; diff --git a/src/ripple_app/peers/Peers.cpp b/src/ripple_app/peers/Peers.cpp index 1893be171e..8a007fe564 100644 --- a/src/ripple_app/peers/Peers.cpp +++ b/src/ripple_app/peers/Peers.cpp @@ -202,20 +202,20 @@ public: // Stoppable // - void onPrepare (Journal) + void onPrepare () { preparePeerFinder(); } - void onStart (Journal) + void onStart () { } - void onStop (Journal) + void onStop () { } - void onChildrenStopped (Journal) + void onChildrenStopped () { // VFALCO TODO Clean this up and do it right, based on sockets stopped(); diff --git a/src/ripple_app/peers/UniqueNodeList.cpp b/src/ripple_app/peers/UniqueNodeList.cpp index 0597976431..1516f17fc7 100644 --- a/src/ripple_app/peers/UniqueNodeList.cpp +++ b/src/ripple_app/peers/UniqueNodeList.cpp @@ -115,7 +115,7 @@ public: //-------------------------------------------------------------------------- - void onStop (Journal) + void onStop () { m_fetchTimer.cancel (); m_scoreTimer.cancel (); diff --git a/src/ripple_app/websocket/WSDoor.cpp b/src/ripple_app/websocket/WSDoor.cpp index 69ef88cc28..6f355f6453 100644 --- a/src/ripple_app/websocket/WSDoor.cpp +++ b/src/ripple_app/websocket/WSDoor.cpp @@ -112,7 +112,7 @@ private: stopped (); } - void onStop (Journal) + void onStop () { { ScopedLockType lock (m_endpointLock, __FILE__, __LINE__); diff --git a/src/ripple_core/functional/JobQueue.cpp b/src/ripple_core/functional/JobQueue.cpp index 8a41bc3c65..0a44d17551 100644 --- a/src/ripple_core/functional/JobQueue.cpp +++ b/src/ripple_core/functional/JobQueue.cpp @@ -645,7 +645,7 @@ private: //-------------------------------------------------------------------------- - void onStop (Journal) + void onStop () { // VFALCO NOTE I wanted to remove all the jobs that are skippable // but then the Workers count of tasks to process @@ -697,7 +697,7 @@ private: */ } - void onChildrenStopped (Journal) + void onChildrenStopped () { ScopedLock lock (m_mutex); diff --git a/src/ripple_net/basics/SNTPClient.cpp b/src/ripple_net/basics/SNTPClient.cpp index 46f1c253c5..07c81d993c 100644 --- a/src/ripple_net/basics/SNTPClient.cpp +++ b/src/ripple_net/basics/SNTPClient.cpp @@ -114,7 +114,7 @@ public: stopped (); } - void onStop (Journal) + void onStop () { // HACK! m_io_service.stop ();