mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +00:00
There's a proper way to workaround the silliness, io_service::work
This commit is contained in:
@@ -35,14 +35,8 @@ DatabaseCon::~DatabaseCon()
|
||||
delete mDatabase;
|
||||
}
|
||||
|
||||
static void resetTimer(boost::asio::deadline_timer* timer)
|
||||
{ // ugly workaround for Boost IO service weirdness
|
||||
timer->expires_from_now(boost::posix_time::hours(24));
|
||||
timer->async_wait(boost::bind(resetTimer, timer));
|
||||
}
|
||||
|
||||
Application::Application() :
|
||||
mIOTimer(mIOService), mAuxTimer(mAuxService), mUNL(mIOService),
|
||||
mIOWork(mIOService), mAuxWork(mAuxService), mUNL(mIOService),
|
||||
mNetOps(mIOService, &mMasterLedger), mTempNodeCache(16384, 90), mHashedObjectStore(16384, 300),
|
||||
mSNTPClient(mAuxService), mRpcDB(NULL), mTxnDB(NULL), mLedgerDB(NULL), mWalletDB(NULL),
|
||||
mHashNodeDB(NULL), mNetNodeDB(NULL),
|
||||
@@ -50,9 +44,6 @@ Application::Application() :
|
||||
{
|
||||
RAND_bytes(mNonce256.begin(), mNonce256.size());
|
||||
RAND_bytes(reinterpret_cast<unsigned char *>(&mNonceST), sizeof(mNonceST));
|
||||
|
||||
resetTimer(&mIOTimer);
|
||||
resetTimer(&mAuxTimer);
|
||||
}
|
||||
|
||||
extern const char *RpcDBInit[], *TxnDBInit[], *LedgerDBInit[], *WalletDBInit[], *HashNodeDBInit[], *NetNodeDBInit[];
|
||||
@@ -60,10 +51,10 @@ extern int RpcDBCount, TxnDBCount, LedgerDBCount, WalletDBCount, HashNodeDBCount
|
||||
|
||||
void Application::stop()
|
||||
{
|
||||
mAuxService.stop();
|
||||
mIOService.stop();
|
||||
mHashedObjectStore.bulkWrite();
|
||||
mValidations.flush();
|
||||
mAuxService.stop();
|
||||
|
||||
Log(lsINFO) << "Stopped: " << mIOService.stopped();
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@ public:
|
||||
|
||||
class Application
|
||||
{
|
||||
boost::asio::io_service mIOService, mAuxService;
|
||||
boost::asio::deadline_timer mIOTimer, mAuxTimer;
|
||||
boost::asio::io_service mIOService, mAuxService;
|
||||
boost::asio::io_service::work mIOWork, mAuxWork;
|
||||
|
||||
Wallet mWallet;
|
||||
UniqueNodeList mUNL;
|
||||
|
||||
Reference in New Issue
Block a user