diff --git a/src/init.cpp b/src/init.cpp index 025ae06520..786e032624 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1317,8 +1317,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node) node.scheduler = MakeUnique(); // Start the lightweight task scheduler thread - CScheduler::Function serviceLoop = [&node]{ node.scheduler->serviceQueue(); }; - threadGroup.create_thread(std::bind(&TraceThread, "scheduler", serviceLoop)); + threadGroup.create_thread([&] { TraceThread("scheduler", [&] { node.scheduler->serviceQueue(); }); }); // Gather some entropy once per minute. node.scheduler->scheduleEvery([]{ diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index 86dac55b2b..37cdbf2dd6 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -129,7 +129,7 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vectorserviceQueue(); }); + threadGroup.create_thread([&] { TraceThread("scheduler", [&] { m_node.scheduler->serviceQueue(); }); }); GetMainSignals().RegisterBackgroundSignalScheduler(*m_node.scheduler); pblocktree.reset(new CBlockTreeDB(1 << 20, true));