mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 03:26:01 +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:
@@ -21,8 +21,8 @@
|
||||
#include <ripple/app/main/LoadManager.h>
|
||||
#include <ripple/app/misc/LoadFeeTrack.h>
|
||||
#include <ripple/app/misc/NetworkOPs.h>
|
||||
#include <ripple/basics/ThreadUtilities.h>
|
||||
#include <ripple/basics/UptimeClock.h>
|
||||
#include <ripple/beast/core/CurrentThreadName.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
@@ -99,7 +99,7 @@ LoadManager::stop()
|
||||
void
|
||||
LoadManager::run()
|
||||
{
|
||||
beast::setCurrentThreadName("LoadManager");
|
||||
this_thread::set_name("LoadManager");
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
using clock_type = std::chrono::steady_clock;
|
||||
|
||||
Reference in New Issue
Block a user