mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Introduce replacement for getting and setting thread name: (#4312)
* In namespace ripple, introduces get_name function that takes a
std:🧵:native_handle_type and returns a std::string.
* In namespace ripple, introduces get_name function that takes a
std::thread or std::jthread and returns a std::string.
* In namespace ripple::this_thread, introduces get_name function
that takes no parameters and returns the name of the current
thread as a std::string.
* In namespace ripple::this_thread, introduces set_name function
that takes a std::string_view and sets the name of the current
thread.
* Intended to replace the beast utilities setCurrentThreadName
and getCurrentThreadName.
This commit is contained in:
@@ -22,9 +22,9 @@
|
||||
#include <ripple/app/rdb/Vacuum.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/basics/StringUtilities.h>
|
||||
#include <ripple/basics/ThreadUtilities.h>
|
||||
#include <ripple/basics/contract.h>
|
||||
#include <ripple/beast/clock/basic_seconds_clock.h>
|
||||
#include <ripple/beast/core/CurrentThreadName.h>
|
||||
#include <ripple/core/Config.h>
|
||||
#include <ripple/core/ConfigSections.h>
|
||||
#include <ripple/core/TimeKeeper.h>
|
||||
@@ -348,8 +348,7 @@ run(int argc, char** argv)
|
||||
{
|
||||
using namespace std;
|
||||
|
||||
beast::setCurrentThreadName(
|
||||
"rippled: main " + BuildInfo::getVersionString());
|
||||
this_thread::set_name("main " + BuildInfo::getVersionString());
|
||||
|
||||
po::variables_map vm;
|
||||
|
||||
@@ -777,7 +776,7 @@ run(int argc, char** argv)
|
||||
}
|
||||
|
||||
// We have an RPC command to process:
|
||||
beast::setCurrentThreadName("rippled: rpc");
|
||||
this_thread::set_name("rippled: rpc");
|
||||
return RPCCall::fromCommandLine(
|
||||
*config, vm["parameters"].as<std::vector<std::string>>(), *logs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user