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

@@ -364,17 +364,20 @@ public:
DebugSink(DebugSink&&) = delete;
DebugSink& operator=(DebugSink&&) = delete;
void
std::unique_ptr<beast::Journal::Sink>
set(std::unique_ptr<beast::Journal::Sink> sink)
{
std::lock_guard<std::mutex> _(m_);
holder_ = std::move(sink);
using std::swap;
swap (holder_, sink);
if (holder_)
sink_ = *holder_;
else
sink_ = beast::Journal::getNullSink();
return sink;
}
beast::Journal::Sink&
@@ -393,11 +396,11 @@ debugSink()
return _;
}
void
std::unique_ptr<beast::Journal::Sink>
setDebugLogSink(
std::unique_ptr<beast::Journal::Sink> sink)
{
debugSink().set(std::move(sink));
return debugSink().set(std::move(sink));
}
beast::Journal::Stream