From d188b138d6f439904b04b89b4b9812fde17ffe01 Mon Sep 17 00:00:00 2001 From: Eric Frias Date: Mon, 25 Aug 2014 18:43:12 -0400 Subject: [PATCH] Allow fc::canceled_exception to pass through places where we were catching and ignoring all fc::exceptions --- src/network/ntp.cpp | 4 ++++ src/thread/future.cpp | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/network/ntp.cpp b/src/network/ntp.cpp index aae4f5c..9febe47 100644 --- a/src/network/ntp.cpp +++ b/src/network/ntp.cpp @@ -60,6 +60,10 @@ namespace fc break; } } + catch (const fc::canceled_exception&) + { + throw; + } // this could fail to resolve but we want to go on to other hosts.. catch ( const fc::exception& e ) { diff --git a/src/thread/future.cpp b/src/thread/future.cpp index 0ea1582..9ccc47f 100644 --- a/src/thread/future.cpp +++ b/src/thread/future.cpp @@ -44,13 +44,16 @@ namespace fc { } void promise_base::_wait( const microseconds& timeout_us ){ - if( timeout_us == microseconds::maximum() ) _wait_until( time_point::maximum() ); - else _wait_until( time_point::now() + timeout_us ); + if( timeout_us == microseconds::maximum() ) + _wait_until( time_point::maximum() ); + else + _wait_until( time_point::now() + timeout_us ); } void promise_base::_wait_until( const time_point& timeout_us ){ { synchronized(_spin_yield) if( _ready ) { - if( _exceptp ) _exceptp->dynamic_rethrow_exception(); + if( _exceptp ) + _exceptp->dynamic_rethrow_exception(); return; } _enqueue_thread();