Skip to content

Commit

Permalink
Print stacktrace when yielding within an exception handler
Browse files Browse the repository at this point in the history
  • Loading branch information
pmconrad committed Sep 16, 2019
1 parent 8abbde1 commit 2df4364
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/thread/thread_d.hpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#include <fc/thread/thread.hpp>
#include <fc/stacktrace.hpp>
#include <fc/time.hpp>
#include <boost/thread.hpp>
#include "context.hpp"
#include <boost/thread/condition_variable.hpp>
#include <boost/thread.hpp>
#include <boost/atomic.hpp>

#include <iostream>
#include <vector>
//#include <fc/logger.hpp>

namespace fc {
struct sleep_priority_less {
Expand Down Expand Up @@ -390,7 +392,8 @@ namespace fc {
/* NB: At least on Win64, this only catches a yield while in the body of
* a catch block; it fails to catch a yield while unwinding the stack, which
* is probably just as likely to cause crashes */
assert(std::current_exception() == std::exception_ptr());
if( std::current_exception() != std::exception_ptr() )
print_stacktrace( std::cerr );

check_for_timeouts();
if( !current )
Expand Down

0 comments on commit 2df4364

Please sign in to comment.