mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Catch unhandled exceptions in I/O service threads (RIPD-1166)
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
#include <BeastConfig.h>
|
#include <BeastConfig.h>
|
||||||
#include <ripple/app/main/BasicApp.h>
|
#include <ripple/app/main/BasicApp.h>
|
||||||
#include <ripple/beast/core/Thread.h>
|
#include <ripple/beast/core/Thread.h>
|
||||||
|
#include <ripple/core/ReportUncaughtException.h>
|
||||||
|
|
||||||
BasicApp::BasicApp(std::size_t numberOfThreads)
|
BasicApp::BasicApp(std::size_t numberOfThreads)
|
||||||
{
|
{
|
||||||
@@ -27,11 +28,15 @@ BasicApp::BasicApp(std::size_t numberOfThreads)
|
|||||||
threads_.reserve(numberOfThreads);
|
threads_.reserve(numberOfThreads);
|
||||||
while(numberOfThreads--)
|
while(numberOfThreads--)
|
||||||
threads_.emplace_back(
|
threads_.emplace_back(
|
||||||
[this, numberOfThreads](){
|
[this, numberOfThreads]()
|
||||||
|
{
|
||||||
beast::Thread::setCurrentThreadName(
|
beast::Thread::setCurrentThreadName(
|
||||||
std::string("io_service #") +
|
std::string("io_service #") +
|
||||||
std::to_string(numberOfThreads));
|
std::to_string(numberOfThreads));
|
||||||
this->io_service_.run();
|
|
||||||
|
ripple::reportUncaughtException (&io_service_,
|
||||||
|
&boost::asio::io_service::run,
|
||||||
|
"io_service::run");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user