From 6872112ab0885d513b869dab50a01df5bb08a9fb Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Mon, 5 Oct 2015 08:44:24 -0400 Subject: [PATCH] adding extra checks for yielding while processing a catch --- src/thread/thread_d.hpp | 6 ++++++ 1 file changed, 6 insertions(+) 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, "" );