Log uncaught exceptions at the top of threads (RIPD-1166)

This commit is contained in:
Scott Schurr
2016-05-25 19:13:34 -07:00
committed by Nik Bougalis
parent 7295d7f4bb
commit fdd1f2ec36
21 changed files with 452 additions and 21 deletions

View File

@@ -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 ())
{