diff options
Diffstat (limited to 'boost/context/fiber_ucontext.hpp')
-rw-r--r-- | boost/context/fiber_ucontext.hpp | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/boost/context/fiber_ucontext.hpp b/boost/context/fiber_ucontext.hpp index ae62389526..6484364784 100644 --- a/boost/context/fiber_ucontext.hpp +++ b/boost/context/fiber_ucontext.hpp @@ -209,11 +209,20 @@ struct BOOST_CONTEXT_DECL fiber_activation_record_initializer { }; struct forced_unwind { - fiber_activation_record * from{ nullptr }; + fiber_activation_record * from{ nullptr }; +#ifndef BOOST_ASSERT_IS_VOID + bool caught{ false }; +#endif forced_unwind( fiber_activation_record * from_) noexcept : from{ from_ } { } + +#ifndef BOOST_ASSERT_IS_VOID + ~forced_unwind() { + BOOST_ASSERT( caught); + } +#endif }; template< typename Ctx, typename StackAlloc, typename Fn > @@ -259,6 +268,9 @@ public: #endif } catch ( forced_unwind const& ex) { c = Ctx{ ex.from }; +#ifndef BOOST_ASSERT_IS_VOID + const_cast< forced_unwind & >( ex).caught = true; +#endif } // this context has finished its task from = nullptr; @@ -462,30 +474,10 @@ public: return nullptr == ptr_ || ptr_->terminated; } - bool operator==( fiber const& other) const noexcept { - return ptr_ == other.ptr_; - } - - bool operator!=( fiber const& other) const noexcept { - return ptr_ != other.ptr_; - } - bool operator<( fiber const& other) const noexcept { return ptr_ < other.ptr_; } - bool operator>( fiber const& other) const noexcept { - return other.ptr_ < ptr_; - } - - bool operator<=( fiber const& other) const noexcept { - return ! ( * this > other); - } - - bool operator>=( fiber const& other) const noexcept { - return ! ( * this < other); - } - template< typename charT, class traitsT > friend std::basic_ostream< charT, traitsT > & operator<<( std::basic_ostream< charT, traitsT > & os, fiber const& other) { @@ -506,6 +498,8 @@ void swap( fiber & l, fiber & r) noexcept { l.swap( r); } +typedef fiber fiber_context; + }} #ifdef BOOST_HAS_ABI_HEADERS |