2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-13 00:12:17 +00:00

std::terminate() called if exception not catched

This commit is contained in:
Oliver Kowalke
2013-10-01 19:44:06 +02:00
parent 147d41833a
commit decba3f33f
10 changed files with 117 additions and 169 deletions

View File

@@ -24,7 +24,12 @@ namespace fibers {
void
fiber::start_fiber_()
{ detail::scheduler::instance()->spawn( impl_); }
{
detail::scheduler::instance()->spawn( impl_);
// check if joined fiber was interrupted
if ( impl_->has_exception() )
impl_->rethrow();
}
int
fiber::priority() const BOOST_NOEXCEPT
@@ -59,14 +64,13 @@ fiber::join()
system::errc::invalid_argument, "boost fiber: fiber not joinable") );
}
try
{ detail::scheduler::instance()->join( impl_); }
catch (...)
{
impl_.reset();
throw;
}
impl_.reset();
detail::scheduler::instance()->join( impl_);
ptr_t tmp;
tmp.swap( impl_);
// check if joined fiber was interrupted
if ( tmp->has_exception() )
tmp->rethrow();
}
void