diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index f0cf6d550..53a884eee 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -508,8 +508,7 @@ bool Blockchain::init(BlockchainDB* db, sqlite3 *lns_db, const network_type nett // create general purpose async service queue m_async_work_idle = std::unique_ptr < boost::asio::io_service::work > (new boost::asio::io_service::work(m_async_service)); - // we only need 1 - m_async_pool.create_thread([this] { m_async_service.run(); }); + m_async_thread = std::thread{[this] { m_async_service.run(); }}; #if defined(PER_BLOCK_CHECKPOINT) if (m_nettype != FAKECHAIN) @@ -647,7 +646,7 @@ bool Blockchain::deinit() // stop async service m_async_work_idle.reset(); - m_async_pool.join_all(); + m_async_thread.join(); m_async_service.stop(); // as this should be called if handling a SIGSEGV, need to check diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h index 50d914ece..06d07ee20 100644 --- a/src/cryptonote_core/blockchain.h +++ b/src/cryptonote_core/blockchain.h @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -1118,7 +1117,7 @@ namespace cryptonote difficulty_type m_difficulty_for_next_block; boost::asio::io_service m_async_service; - boost::thread_group m_async_pool; + std::thread m_async_thread; std::unique_ptr m_async_work_idle; // some invalid blocks