diff --git a/src/cpp/ripple/Application.cpp b/src/cpp/ripple/Application.cpp index 5abf6bbc10..b4bbb57133 100644 --- a/src/cpp/ripple/Application.cpp +++ b/src/cpp/ripple/Application.cpp @@ -103,9 +103,7 @@ void Application::run() LogPartition::setSeverity(lsDEBUG); } - boost::thread auxThread(boost::bind(&boost::asio::io_service::run, &mAuxService)); - auxThread.detach(); - + boost::thread(boost::bind(&boost::asio::io_service::run, &mAuxService)).detach(); if (!theConfig.RUN_STANDALONE) mSNTPClient.init(theConfig.SNTP_SERVERS); diff --git a/src/cpp/ripple/HashedObject.cpp b/src/cpp/ripple/HashedObject.cpp index f59a186fe1..e7432ec727 100644 --- a/src/cpp/ripple/HashedObject.cpp +++ b/src/cpp/ripple/HashedObject.cpp @@ -42,8 +42,7 @@ bool HashedObjectStore::store(HashedObjectType type, uint32 index, if (!mWritePending) { mWritePending = true; - boost::thread t(boost::bind(&HashedObjectStore::bulkWrite, this)); - t.detach(); + boost::thread(boost::bind(&HashedObjectStore::bulkWrite, this)).detach(); } } // else diff --git a/src/cpp/ripple/JobQueue.cpp b/src/cpp/ripple/JobQueue.cpp index 5abfbb81ac..508398b1fc 100644 --- a/src/cpp/ripple/JobQueue.cpp +++ b/src/cpp/ripple/JobQueue.cpp @@ -204,8 +204,7 @@ void JobQueue::setThreadCount(int c) while (mThreadCount < c) { ++mThreadCount; - boost::thread t(boost::bind(&JobQueue::threadEntry, this)); - t.detach(); + boost::thread(boost::bind(&JobQueue::threadEntry, this)).detach(); } while (mThreadCount > c) { diff --git a/src/cpp/ripple/Ledger.cpp b/src/cpp/ripple/Ledger.cpp index cd3bcd4698..7cad5e55b9 100644 --- a/src/cpp/ripple/Ledger.cpp +++ b/src/cpp/ripple/Ledger.cpp @@ -1167,9 +1167,8 @@ void Ledger::pendSave(bool fromConsensus) if (!fromConsensus && !theApp->isNewFlag(getHash(), SF_SAVED)) return; - boost::thread thread(boost::bind(&Ledger::saveAcceptedLedger, shared_from_this(), - fromConsensus, theApp->getJobQueue().getLoadEvent(jtDISK))); - thread.detach(); + boost::thread(boost::bind(&Ledger::saveAcceptedLedger, shared_from_this(), + fromConsensus, theApp->getJobQueue().getLoadEvent(jtDISK))).detach(); boost::recursive_mutex::scoped_lock sl(sPendingSaveLock); ++sPendingSaves;