Allow fc::canceled_exception to pass through places where we were catching and ignoring all fc::exceptions

This commit is contained in:
Eric Frias 2014-08-25 18:43:12 -04:00
parent 27096f15a7
commit d188b138d6
2 changed files with 10 additions and 3 deletions

View file

@ -60,6 +60,10 @@ namespace fc
break; break;
} }
} }
catch (const fc::canceled_exception&)
{
throw;
}
// this could fail to resolve but we want to go on to other hosts.. // this could fail to resolve but we want to go on to other hosts..
catch ( const fc::exception& e ) catch ( const fc::exception& e )
{ {

View file

@ -44,13 +44,16 @@ namespace fc {
} }
void promise_base::_wait( const microseconds& timeout_us ){ void promise_base::_wait( const microseconds& timeout_us ){
if( timeout_us == microseconds::maximum() ) _wait_until( time_point::maximum() ); if( timeout_us == microseconds::maximum() )
else _wait_until( time_point::now() + timeout_us ); _wait_until( time_point::maximum() );
else
_wait_until( time_point::now() + timeout_us );
} }
void promise_base::_wait_until( const time_point& timeout_us ){ void promise_base::_wait_until( const time_point& timeout_us ){
{ synchronized(_spin_yield) { synchronized(_spin_yield)
if( _ready ) { if( _ready ) {
if( _exceptp ) _exceptp->dynamic_rethrow_exception(); if( _exceptp )
_exceptp->dynamic_rethrow_exception();
return; return;
} }
_enqueue_thread(); _enqueue_thread();