diff --git a/include/boost/fiber/context.hpp b/include/boost/fiber/context.hpp index 64511415..84145a17 100644 --- a/include/boost/fiber/context.hpp +++ b/include/boost/fiber/context.hpp @@ -276,29 +276,29 @@ public: void set_ready( context *) noexcept; bool is_main_context() const noexcept { - return flags_ & flag_main_context; + return 0 != ( flags_ & flag_main_context); } bool is_dispatcher_context() const noexcept { - return flags_ & flag_dispatcher_context; + return 0 != ( flags_ & flag_dispatcher_context); } bool is_worker_context() const noexcept { - return flags_ & flag_worker_context; + return 0 != ( flags_ & flag_worker_context); } bool is_terminated() const noexcept { - return flags_ & flag_terminated; + return 0 != ( flags_ & flag_terminated); } bool interruption_blocked() const noexcept { - return flags_ & flag_interruption_blocked; + return 0 != ( flags_ & flag_interruption_blocked); } void interruption_blocked( bool blck) noexcept; bool interruption_requested() const noexcept { - return flags_ & flag_interruption_requested; + return 0 != ( flags_ & flag_interruption_requested); } void request_interruption( bool req) noexcept; diff --git a/src/context.cpp b/src/context.cpp index 772fa68c..d24ddee1 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -147,13 +147,8 @@ void context::join() { // get active context context * active_ctx = context::active(); - try { // context::join() is a interruption point this_fiber::interruption_point(); - } catch ( boost::fibers::fiber_interrupted const&) { - fprintf(stderr, "context::join() -> throw\n"); - throw; - } // protect for concurrent access std::unique_lock< detail::spinlock > lk( splk_); // wait for context which is not terminated diff --git a/test/test_fiber.cpp b/test/test_fiber.cpp index d0ea1733..da92167d 100644 --- a/test/test_fiber.cpp +++ b/test/test_fiber.cpp @@ -322,7 +322,6 @@ void do_join( boost::fibers::fiber * f, bool * interrupted) { f->join(); } catch ( ... ) { * interrupted = true; - fprintf(stderr, "do_join() -> throw\n"); } } @@ -331,7 +330,7 @@ void test_fiber_interrupt_at_join() { boost::fibers::barrier b( 2); boost::fibers::fiber f1(do_wait, & b); boost::fibers::fiber f2(do_join, & f1, & interrupted); - //boost::this_fiber::yield(); + boost::this_fiber::yield(); f2.interrupt(); f2.join(); b.wait(); @@ -376,7 +375,7 @@ void test_sleep_until_is_interruption_point() { boost::unit_test::test_suite * init_unit_test_suite( int, char* []) { boost::unit_test::test_suite * test = BOOST_TEST_SUITE("Boost.Fiber: fiber test suite"); -#if 0 + test->add( BOOST_TEST_CASE( & test_scheduler_dtor) ); test->add( BOOST_TEST_CASE( & test_join_fn) ); test->add( BOOST_TEST_CASE( & test_join_memfn) ); @@ -390,12 +389,9 @@ boost::unit_test::test_suite * init_unit_test_suite( int, char* []) { test->add( BOOST_TEST_CASE( & test_sleep_until) ); test->add( BOOST_TEST_CASE( & test_fiber_interrupts_at_interruption_point) ); test->add( BOOST_TEST_CASE( & test_fiber_no_interrupt_if_interrupts_disabled_at_interruption_point) ); -#endif test->add( BOOST_TEST_CASE( & test_fiber_interrupt_at_join) ); -#if 0 test->add( BOOST_TEST_CASE( & test_sleep_for_is_interruption_point) ); test->add( BOOST_TEST_CASE( & test_sleep_until_is_interruption_point) ); -#endif return test; }