Check if the node should stop when processing thread interrupts and exceptions, in hopes of stopping before a deadlock occurs
This commit is contained in:
@@ -47,6 +47,8 @@ static const bool DEFAULT_LOGTIMEMICROS = false;
|
|||||||
static const bool DEFAULT_LOGIPS = false;
|
static const bool DEFAULT_LOGIPS = false;
|
||||||
static const bool DEFAULT_LOGTIMESTAMPS = true;
|
static const bool DEFAULT_LOGTIMESTAMPS = true;
|
||||||
|
|
||||||
|
void CheckIfWeShouldStop();
|
||||||
|
|
||||||
/** Signals for translation. */
|
/** Signals for translation. */
|
||||||
class CTranslationInterface
|
class CTranslationInterface
|
||||||
{
|
{
|
||||||
@@ -272,14 +274,17 @@ template <typename Callable> void TraceThread(const char* name, Callable func)
|
|||||||
catch (const boost::thread_interrupted&)
|
catch (const boost::thread_interrupted&)
|
||||||
{
|
{
|
||||||
LogPrintf("%s thread interrupt\n", name);
|
LogPrintf("%s thread interrupt\n", name);
|
||||||
|
CheckIfWeShouldStop();
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
catch (const std::exception& e) {
|
catch (const std::exception& e) {
|
||||||
PrintExceptionContinue(&e, name);
|
PrintExceptionContinue(&e, name);
|
||||||
|
CheckIfWeShouldStop();
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
PrintExceptionContinue(NULL, name);
|
PrintExceptionContinue(NULL, name);
|
||||||
|
CheckIfWeShouldStop();
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user