diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-04-13 21:17:55 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-04-29 18:39:01 +0300 |
commit | a508f718f3e087c96a306399582a85df2e1d53ae (patch) | |
tree | e3bc35738c1489f5324fb08e65f8d6ec8a7902ab /src | |
parent | 30e44482152488a78f2c495798a75e6f553dc0c8 (diff) |
refactor: Use appropriate thread constructor
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 2 | ||||
-rw-r--r-- | src/mapport.cpp | 2 | ||||
-rw-r--r-- | src/test/util/setup_common.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp index e78e97ae35..896cb774b5 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1267,7 +1267,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) node.scheduler = std::make_unique<CScheduler>(); // Start the lightweight task scheduler thread - node.scheduler->m_service_thread = std::thread([&] { util::TraceThread("scheduler", [&] { node.scheduler->serviceQueue(); }); }); + node.scheduler->m_service_thread = std::thread(util::TraceThread, "scheduler", [&] { node.scheduler->serviceQueue(); }); // Gather some entropy once per minute. node.scheduler->scheduleEvery([]{ diff --git a/src/mapport.cpp b/src/mapport.cpp index 315c4b525f..135efb561e 100644 --- a/src/mapport.cpp +++ b/src/mapport.cpp @@ -256,7 +256,7 @@ void StartThreadMapPort() { if (!g_mapport_thread.joinable()) { assert(!g_mapport_interrupt); - g_mapport_thread = std::thread(std::bind(&util::TraceThread, "mapport", &ThreadMapPort)); + g_mapport_thread = std::thread(&util::TraceThread, "mapport", &ThreadMapPort); } } diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index eb3ec3446b..c10f1eea13 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -134,7 +134,7 @@ ChainTestingSetup::ChainTestingSetup(const std::string& chainName, const std::ve // We have to run a scheduler thread to prevent ActivateBestChain // from blocking due to queue overrun. m_node.scheduler = std::make_unique<CScheduler>(); - m_node.scheduler->m_service_thread = std::thread([&] { util::TraceThread("scheduler", [&] { m_node.scheduler->serviceQueue(); }); }); + m_node.scheduler->m_service_thread = std::thread(util::TraceThread, "scheduler", [&] { m_node.scheduler->serviceQueue(); }); GetMainSignals().RegisterBackgroundSignalScheduler(*m_node.scheduler); pblocktree.reset(new CBlockTreeDB(1 << 20, true)); |