mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Log uncaught exceptions at the top of threads (RIPD-1166)
This commit is contained in:
committed by
Nik Bougalis
parent
7295d7f4bb
commit
fdd1f2ec36
@@ -18,6 +18,7 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/core/impl/Workers.h>
|
||||
#include <ripple/core/ReportUncaughtException.h>
|
||||
#include <ripple/beast/unit_test.h>
|
||||
#include <cassert>
|
||||
|
||||
@@ -156,6 +157,16 @@ Workers::Worker::~Worker ()
|
||||
}
|
||||
|
||||
void Workers::Worker::run ()
|
||||
{
|
||||
// Call runImpl() and report if any exceptions escape runImpl.
|
||||
reportUncaughtException (this, &Workers::Worker::runImpl,
|
||||
"Workers::Worker::run()", [this] ()
|
||||
{
|
||||
return "Thread: " + Thread::getThreadName();
|
||||
});
|
||||
}
|
||||
|
||||
void Workers::Worker::runImpl ()
|
||||
{
|
||||
while (! threadShouldExit ())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user