diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-04-13 20:44:46 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-04-25 12:28:44 +0300 |
commit | 30e44482152488a78f2c495798a75e6f553dc0c8 (patch) | |
tree | 3a23901c0ed8c22ebad5cf8451be272f72fd2989 /src/init.cpp | |
parent | a1f0b8b62eb851c837a3618583b7c2fd4d12006c (diff) |
refactor: Make TraceThread a non-template free function
Also it is moved into its own module.
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp index 07e882c9df..e78e97ae35 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -58,6 +58,7 @@ #include <util/moneystr.h> #include <util/string.h> #include <util/system.h> +#include <util/thread.h> #include <util/threadnames.h> #include <util/translation.h> #include <validation.h> @@ -1266,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([&] { 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([]{ @@ -1791,7 +1792,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) vImportFiles.push_back(strFile); } - chainman.m_load_block = std::thread(&TraceThread<std::function<void()>>, "loadblk", [=, &chainman, &args] { + chainman.m_load_block = std::thread(&util::TraceThread, "loadblk", [=, &chainman, &args] { ThreadImport(chainman, vImportFiles, args); }); |