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:
@@ -18,7 +18,7 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/app/main/BasicApp.h>
|
||||
#include <ripple/beast/core/CurrentThreadName.h>
|
||||
#include <ripple/basics/ThreadUtilities.h>
|
||||
|
||||
BasicApp::BasicApp(std::size_t numberOfThreads)
|
||||
{
|
||||
@@ -28,7 +28,7 @@ BasicApp::BasicApp(std::size_t numberOfThreads)
|
||||
while (numberOfThreads--)
|
||||
{
|
||||
threads_.emplace_back([this, numberOfThreads]() {
|
||||
beast::setCurrentThreadName(
|
||||
ripple::this_thread::set_name(
|
||||
"io svc #" + std::to_string(numberOfThreads));
|
||||
this->io_service_.run();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user