mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 10:42:13 +02:00
Merge bitcoin/bitcoin#19064: refactor: Cleanup thread ctor calls
792be53d3erefactor: Replace std::bind with lambdas (Hennadii Stepanov)a508f718f3refactor: Use appropriate thread constructor (Hennadii Stepanov)30e4448215refactor: Make TraceThread a non-template free function (Hennadii Stepanov) Pull request description: This PR does not change behavior. Its goal is to improve readability and maintainability of the code. ACKs for top commit: jnewbery: utACK792be53d3ejonatack: tACK792be53d3eMarcoFalke: cr ACK792be53d3eTree-SHA512: a03142f04f370f6bc02bd3ddfa870819b51740fcd028772241d68c84087f95a2d78207cbd5edb3f7c636fcf2d76192d9c59873f8f0af451d3b05c0cf9cf234df
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
#include <sync.h>
|
||||
#include <tinyformat.h>
|
||||
#include <util/settings.h>
|
||||
#include <util/threadnames.h>
|
||||
#include <util/time.h>
|
||||
|
||||
#include <any>
|
||||
@@ -478,28 +477,6 @@ std::string HelpMessageOpt(const std::string& option, const std::string& message
|
||||
*/
|
||||
int GetNumCores();
|
||||
|
||||
/**
|
||||
* .. and a wrapper that just calls func once
|
||||
*/
|
||||
template <typename Callable> void TraceThread(const char* name, Callable func)
|
||||
{
|
||||
util::ThreadRename(name);
|
||||
try
|
||||
{
|
||||
LogPrintf("%s thread start\n", name);
|
||||
func();
|
||||
LogPrintf("%s thread exit\n", name);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
PrintExceptionContinue(&e, name);
|
||||
throw;
|
||||
}
|
||||
catch (...) {
|
||||
PrintExceptionContinue(nullptr, name);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
std::string CopyrightHolders(const std::string& strPrefix);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user