Remove beast::Thread (RIPD-1189):

All uses of beast::Thread were previously removed from the code
base, so beast::Thread is removed.  One piece of beast::Thread
needed to be preserved: the ability to set the current thread's
name.  So there's now a beast::CurrentThreadName that allows the
current thread's name to be set and returned.

Thread naming is also cleaned up a bit.  ThreadName.h and .cpp
are removed since beast::CurrentThreadName does a better job.
ThreadEntry is also removed, but its terminateHandler() is
preserved in TerminateHandler.cpp.  The revised terminateHandler()
uses beast::CurrentThreadName to recover the name of the running
thread.

Finally, the NO_LOG_UNHANDLED_EXCEPTIONS #define is removed since
it was discovered that the MacOS debugger preserves the stack
of the original throw even if the terminateHandler() rethrows.
This commit is contained in:
Scott Schurr
2017-01-06 17:59:21 -08:00
committed by seelabs
parent 2c6b0f3193
commit ce9238b389
42 changed files with 546 additions and 891 deletions

View File

@@ -25,7 +25,7 @@
#include <ripple/app/main/Application.h>
#include <ripple/basics/contract.h>
#include <ripple/core/ConfigSections.h>
#include <ripple/core/ThreadEntry.h>
#include <ripple/beast/core/CurrentThreadName.h>
#include <boost/format.hpp>
#include <boost/format.hpp>
#include <boost/optional.hpp>
@@ -298,13 +298,7 @@ SHAMapStoreImp::copyNode (std::uint64_t& nodeCount,
void
SHAMapStoreImp::run()
{
threadEntry (
this, &SHAMapStoreImp::runImpl, "SHAMapStoreImp::run()");
}
void
SHAMapStoreImp::runImpl()
{
beast::setCurrentThreadName ("SHAMapStore");
LedgerIndex lastRotated = state_db_.getState().lastRotated;
netOPs_ = &app_.getOPs();
ledgerMaster_ = &app_.getLedgerMaster();