mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Remove beast::Thread (RIPD-1189):
All uses of beast::Thread were previously removed from the code base, so beast::Thread is removed. One piece of beast::Thread needed to be preserved: the ability to set the current thread's name. So there's now a beast::CurrentThreadName that allows the current thread's name to be set and returned. Thread naming is also cleaned up a bit. ThreadName.h and .cpp are removed since beast::CurrentThreadName does a better job. ThreadEntry is also removed, but its terminateHandler() is preserved in TerminateHandler.cpp. The revised terminateHandler() uses beast::CurrentThreadName to recover the name of the running thread. Finally, the NO_LOG_UNHANDLED_EXCEPTIONS #define is removed since it was discovered that the MacOS debugger preserves the stack of the original throw even if the terminateHandler() rethrows.
This commit is contained in:
@@ -19,8 +19,7 @@
|
||||
|
||||
#include <BeastConfig.h>
|
||||
#include <ripple/app/main/BasicApp.h>
|
||||
#include <ripple/beast/core/Thread.h>
|
||||
#include <ripple/core/ThreadEntry.h>
|
||||
#include <ripple/beast/core/CurrentThreadName.h>
|
||||
|
||||
BasicApp::BasicApp(std::size_t numberOfThreads)
|
||||
{
|
||||
@@ -30,13 +29,10 @@ BasicApp::BasicApp(std::size_t numberOfThreads)
|
||||
threads_.emplace_back(
|
||||
[this, numberOfThreads]()
|
||||
{
|
||||
beast::Thread::setCurrentThreadName(
|
||||
beast::setCurrentThreadName(
|
||||
std::string("io_service #") +
|
||||
std::to_string(numberOfThreads));
|
||||
|
||||
ripple::threadEntry (&io_service_,
|
||||
&boost::asio::io_service::run,
|
||||
"io_service::run");
|
||||
this->io_service_.run();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user