diff --git a/src/thread/thread_d.hpp b/src/thread/thread_d.hpp index f2855d8..bb7370f 100644 --- a/src/thread/thread_d.hpp +++ b/src/thread/thread_d.hpp @@ -665,6 +665,9 @@ namespace fc { if( tp <= (time_point::now()+fc::microseconds(10000)) ) return; + FC_ASSERT(std::current_exception() == std::exception_ptr(), + "Attempting to yield while processing an exception"); + if( !current ) current = new fc::context(&fc::thread::current()); @@ -698,6 +701,9 @@ namespace fc { if( p->ready() ) return; + FC_ASSERT(std::current_exception() == std::exception_ptr(), + "Attempting to yield while processing an exception"); + if( timeout < time_point::now() ) FC_THROW_EXCEPTION( timeout_exception, "" );