mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 22:45:52 +00:00
Rename reportUncaughtExceptions to threadEntry
This commit is contained in:
@@ -2050,8 +2050,6 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\core\LoadMonitor.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\core\ReportUncaughtException.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\core\SociDB.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\core\Stoppable.h">
|
||||
@@ -2092,6 +2090,8 @@
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\soci\src\core;..\..\src\sqlite;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\core\ThreadEntry.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\core\TimeKeeper.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\crypto\csprng.h">
|
||||
|
||||
@@ -2592,9 +2592,6 @@
|
||||
<ClInclude Include="..\..\src\ripple\core\LoadMonitor.h">
|
||||
<Filter>ripple\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\core\ReportUncaughtException.h">
|
||||
<Filter>ripple\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\core\SociDB.h">
|
||||
<Filter>ripple\core</Filter>
|
||||
</ClInclude>
|
||||
@@ -2619,6 +2616,9 @@
|
||||
<ClCompile Include="..\..\src\ripple\core\tests\Stoppable.test.cpp">
|
||||
<Filter>ripple\core\tests</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\core\ThreadEntry.h">
|
||||
<Filter>ripple\core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\core\TimeKeeper.h">
|
||||
<Filter>ripple\core</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <ripple/app/ledger/InboundLedgers.h>
|
||||
#include <ripple/app/ledger/LedgerMaster.h>
|
||||
#include <ripple/core/LoadFeeTrack.h>
|
||||
#include <ripple/core/ReportUncaughtException.h>
|
||||
#include <ripple/core/ThreadEntry.h>
|
||||
#include <ripple/protocol/JsonFields.h>
|
||||
#include <ripple/beast/core/Thread.h>
|
||||
|
||||
@@ -243,7 +243,7 @@ private:
|
||||
|
||||
void run ()
|
||||
{
|
||||
reportUncaughtException (
|
||||
threadEntry (
|
||||
this, &LedgerCleanerImp::runImpl, "LedgerCleanerImp::run()");
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <BeastConfig.h>
|
||||
#include <ripple/app/main/BasicApp.h>
|
||||
#include <ripple/beast/core/Thread.h>
|
||||
#include <ripple/core/ReportUncaughtException.h>
|
||||
#include <ripple/core/ThreadEntry.h>
|
||||
|
||||
BasicApp::BasicApp(std::size_t numberOfThreads)
|
||||
{
|
||||
@@ -34,7 +34,7 @@ BasicApp::BasicApp(std::size_t numberOfThreads)
|
||||
std::string("io_service #") +
|
||||
std::to_string(numberOfThreads));
|
||||
|
||||
ripple::reportUncaughtException (&io_service_,
|
||||
ripple::threadEntry (&io_service_,
|
||||
&boost::asio::io_service::run,
|
||||
"io_service::run");
|
||||
});
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <ripple/app/misc/NetworkOPs.h>
|
||||
#include <ripple/basics/UptimeTimer.h>
|
||||
#include <ripple/core/LoadFeeTrack.h>
|
||||
#include <ripple/core/ReportUncaughtException.h>
|
||||
#include <ripple/core/ThreadEntry.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <ripple/beast/core/Thread.h>
|
||||
#include <memory>
|
||||
@@ -108,7 +108,7 @@ void LoadManager::onStop ()
|
||||
|
||||
void LoadManager::run ()
|
||||
{
|
||||
reportUncaughtException (this, &LoadManager::runImpl, "LoadManager::run()");
|
||||
threadEntry (this, &LoadManager::runImpl, "LoadManager::run()");
|
||||
}
|
||||
|
||||
void LoadManager::runImpl ()
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <ripple/app/main/Application.h>
|
||||
#include <ripple/basics/contract.h>
|
||||
#include <ripple/core/ConfigSections.h>
|
||||
#include <ripple/core/ReportUncaughtException.h>
|
||||
#include <ripple/core/ThreadEntry.h>
|
||||
#include <boost/format.hpp>
|
||||
#include <boost/format.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
@@ -298,7 +298,7 @@ SHAMapStoreImp::copyNode (std::uint64_t& nodeCount,
|
||||
void
|
||||
SHAMapStoreImp::run()
|
||||
{
|
||||
reportUncaughtException (
|
||||
threadEntry (
|
||||
this, &SHAMapStoreImp::runImpl, "SHAMapStoreImp::run()");
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_CORE_REPORT_UNCAUGHT_EXCEPTION_H_INCLUDED
|
||||
#define RIPPLE_CORE_REPORT_UNCAUGHT_EXCEPTION_H_INCLUDED
|
||||
#ifndef RIPPLE_CORE_THREAD_ENTRY_H_INCLUDED
|
||||
#define RIPPLE_CORE_THREAD_ENTRY_H_INCLUDED
|
||||
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <boost/coroutine/exceptions.hpp> // forced_unwind exception
|
||||
@@ -52,7 +52,7 @@ uncaught exception. The lambda is only called in the error case.
|
||||
|
||||
Usage example
|
||||
|
||||
#include <ripple/core/ReportUncaughtException.h>
|
||||
#include <ripple/core/ThreadEntry.h>
|
||||
#include <chrono>
|
||||
#include <exception>
|
||||
#include <thread>
|
||||
@@ -62,7 +62,7 @@ class ThreadedHandler
|
||||
public:
|
||||
void operator() ()
|
||||
{
|
||||
reportUncaughtException (
|
||||
threadEntry (
|
||||
this, &ThreadedHandler::runImpl, "ThreadedHandler::operator()");
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ int main ()
|
||||
@param lamdba Optional lambda that returns additional text for the log.
|
||||
*/
|
||||
template <typename T, typename R, typename L>
|
||||
void reportUncaughtException (
|
||||
void threadEntry (
|
||||
T* t, R (T::*threadTop) (), char const* name, L&& lambda)
|
||||
{
|
||||
// Enforce that lambda takes no parameters and returns std::string.
|
||||
@@ -142,10 +142,10 @@ void reportUncaughtException (
|
||||
|
||||
// Handle the common case where there is no additional local information.
|
||||
template <typename T, typename R>
|
||||
inline void reportUncaughtException (
|
||||
inline void threadEntry (
|
||||
T* t, R (T::*threadTop) (), char const* name)
|
||||
{
|
||||
reportUncaughtException (t, threadTop, name, []{ return std::string(); });
|
||||
threadEntry (t, threadTop, name, []{ return std::string(); });
|
||||
}
|
||||
|
||||
} // namespace ripple
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <BeastConfig.h>
|
||||
#include <ripple/core/DeadlineTimer.h>
|
||||
#include <ripple/core/ReportUncaughtException.h>
|
||||
#include <ripple/core/ThreadEntry.h>
|
||||
#include <ripple/beast/core/Thread.h>
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
|
||||
void run () override
|
||||
{
|
||||
reportUncaughtException (
|
||||
threadEntry (
|
||||
this, &Manager::runImpl, "DeadlineTimer::Manager::run()");
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <BeastConfig.h>
|
||||
#include <ripple/core/Job.h>
|
||||
#include <ripple/core/ReportUncaughtException.h>
|
||||
#include <ripple/core/ThreadEntry.h>
|
||||
#include <cassert>
|
||||
|
||||
namespace ripple {
|
||||
@@ -77,7 +77,7 @@ bool Job::shouldCancel () const
|
||||
|
||||
void Job::doJob ()
|
||||
{
|
||||
reportUncaughtException (this, &Job::doJobImpl, "Job::doJob()",
|
||||
threadEntry (this, &Job::doJobImpl, "Job::doJob()",
|
||||
[this] ()
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <ripple/basics/ThreadName.h>
|
||||
#include <ripple/basics/random.h>
|
||||
#include <ripple/beast/core/Thread.h>
|
||||
#include <ripple/core/ReportUncaughtException.h>
|
||||
#include <ripple/core/ThreadEntry.h>
|
||||
#include <beast/core/placeholders.hpp>
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
@@ -209,7 +209,7 @@ public:
|
||||
using Pio_service_mem = std::size_t (boost::asio::io_service::*)();
|
||||
Pio_service_mem pRun = &boost::asio::io_service::run;
|
||||
|
||||
reportUncaughtException (&io_service_, pRun, "SNTPClientImp::doRun()");
|
||||
threadEntry (&io_service_, pRun, "SNTPClientImp::doRun()");
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/core/impl/Workers.h>
|
||||
#include <ripple/core/ReportUncaughtException.h>
|
||||
#include <ripple/core/ThreadEntry.h>
|
||||
#include <ripple/beast/unit_test.h>
|
||||
#include <cassert>
|
||||
|
||||
@@ -159,7 +159,7 @@ Workers::Worker::~Worker ()
|
||||
void Workers::Worker::run ()
|
||||
{
|
||||
// Call runImpl() and report if any exceptions escape runImpl.
|
||||
reportUncaughtException (this, &Workers::Worker::runImpl,
|
||||
threadEntry (this, &Workers::Worker::runImpl,
|
||||
"Workers::Worker::run()", [this] ()
|
||||
{
|
||||
return "Thread: " + Thread::getThreadName();
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/basics/TestSuite.h>
|
||||
#include <ripple/core/ReportUncaughtException.h>
|
||||
#include <ripple/core/ThreadEntry.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
// reportUncaughtException is disabled if NO_LOG_UNHANDLED_EXCEPTIONS is defined.
|
||||
// threadEntry is disabled if NO_LOG_UNHANDLED_EXCEPTIONS is defined.
|
||||
#ifndef NO_LOG_UNHANDLED_EXCEPTIONS
|
||||
|
||||
class ReportUncaughtException_test : public TestSuite
|
||||
@@ -96,11 +96,11 @@ public:
|
||||
ExceptionGen exGen;
|
||||
|
||||
// Make sure nothing gets logged if there's no exception.
|
||||
reportUncaughtException (&exGen, &ExceptionGen::dontThrow, "noThrow");
|
||||
threadEntry (&exGen, &ExceptionGen::dontThrow, "noThrow");
|
||||
expect (sinkRef.getText() == "");
|
||||
sinkRef.reset();
|
||||
|
||||
reportUncaughtException (&exGen, &ExceptionGen::dontThrow, "noThrow",
|
||||
threadEntry (&exGen, &ExceptionGen::dontThrow, "noThrow",
|
||||
[] { return "Just noise"; });
|
||||
|
||||
expect (sinkRef.getText() == "");
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
bool gotException = false;
|
||||
try
|
||||
{
|
||||
reportUncaughtException (&exGen, call, "testFn");
|
||||
threadEntry (&exGen, call, "testFn");
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
gotException = false;
|
||||
try
|
||||
{
|
||||
reportUncaughtException (&exGen, call, "testFn",
|
||||
threadEntry (&exGen, call, "testFn",
|
||||
[]{ return "extra info"; });
|
||||
}
|
||||
catch (...)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <ripple/basics/KeyCache.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/basics/chrono.h>
|
||||
#include <ripple/core/ReportUncaughtException.h>
|
||||
#include <ripple/core/ThreadEntry.h>
|
||||
#include <ripple/protocol/digest.h>
|
||||
#include <ripple/basics/Slice.h>
|
||||
#include <ripple/basics/TaggedCache.h>
|
||||
@@ -337,7 +337,7 @@ public:
|
||||
// Uncaught exception handling for async read threads
|
||||
void threadEntry ()
|
||||
{
|
||||
reportUncaughtException (
|
||||
::ripple::threadEntry (
|
||||
this, &DatabaseImp::threadEntryImpl, "DatabaseImp::threadEntry()");
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <ripple/resource/impl/Logic.h>
|
||||
#include <ripple/basics/chrono.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/core/ReportUncaughtException.h>
|
||||
#include <ripple/core/ThreadEntry.h>
|
||||
#include <ripple/beast/core/Thread.h>
|
||||
#include <condition_variable>
|
||||
#include <memory>
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
private:
|
||||
void run ()
|
||||
{
|
||||
reportUncaughtException (
|
||||
threadEntry (
|
||||
this, &ManagerImp::runImpl, "Resource::Manager::run()");
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define RIPPLE_WEBSOCKET_SERVER_H_INCLUDED
|
||||
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/core/ReportUncaughtException.h>
|
||||
#include <ripple/core/ThreadEntry.h>
|
||||
#include <ripple/websocket/WebSocket.h>
|
||||
#include <ripple/beast/core/Thread.h>
|
||||
#include <condition_variable>
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
private:
|
||||
void run ()
|
||||
{
|
||||
reportUncaughtException (
|
||||
threadEntry (
|
||||
this, &Server::runImpl, "Server<WebSocket>::run()");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user