diff --git a/include/boost/fiber/algorithm.hpp b/include/boost/fiber/algorithm.hpp index f8652ef3..66178534 100644 --- a/include/boost/fiber/algorithm.hpp +++ b/include/boost/fiber/algorithm.hpp @@ -10,6 +10,7 @@ #include #include +#include #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX @@ -17,7 +18,6 @@ namespace boost { namespace fibers { -class fiber_context; struct BOOST_FIBERS_DECL sched_algorithm { virtual ~sched_algorithm() {} diff --git a/include/boost/fiber/detail/waiting_queue.hpp b/include/boost/fiber/detail/waiting_queue.hpp index 9409fc07..d65b0870 100644 --- a/include/boost/fiber/detail/waiting_queue.hpp +++ b/include/boost/fiber/detail/waiting_queue.hpp @@ -44,7 +44,7 @@ public: fiber_context * top() const noexcept { BOOST_ASSERT( ! empty() ); - return static_cast(head_); + return head_; } void move_to( sched_algorithm *); diff --git a/include/boost/fiber/fiber.hpp b/include/boost/fiber/fiber.hpp index 34f94df6..5a4e0ad3 100644 --- a/include/boost/fiber/fiber.hpp +++ b/include/boost/fiber/fiber.hpp @@ -119,7 +119,7 @@ public: template PROPS& properties() { - return detail::scheduler::instance()->properties(impl_.get()); + return dynamic_cast(*impl_->get_properties()); } }; diff --git a/include/boost/fiber/fiber_manager.hpp b/include/boost/fiber/fiber_manager.hpp index 6b497891..43fcfd81 100644 --- a/include/boost/fiber/fiber_manager.hpp +++ b/include/boost/fiber/fiber_manager.hpp @@ -94,21 +94,6 @@ public: std::chrono::high_resolution_clock::duration wait_interval() noexcept; - // implementation for fiber::properties() - template < class PROPS > - PROPS& properties( fiber_context * f ) - { - return dynamic_cast&>(*get_sched_algo_()) - .properties(f); - } - - // implementation for this_fiber::properties() - template < class PROPS > - PROPS& properties() - { - return properties(active()); - } - void preserve_fpu( bool); }; diff --git a/include/boost/fiber/operations.hpp b/include/boost/fiber/operations.hpp index 4ccdf245..95f0e73b 100644 --- a/include/boost/fiber/operations.hpp +++ b/include/boost/fiber/operations.hpp @@ -52,7 +52,7 @@ void sleep_for( std::chrono::duration< Rep, Period > const& timeout_duration) { template < class PROPS > PROPS& properties() { - return fibers::detail::scheduler::instance()->active()->properties(); + return dynamic_cast(*fibers::detail::scheduler::instance()->active()->get_properties()); } } // this_fiber