R * yield()
    {
        BOOST_ASSERT( is_running() );
        BOOST_ASSERT( ! is_complete() );

        flags_ &= ~flag_running;
        param_type to;
        param_type * from(
            reinterpret_cast< param_type * >(
                callee_.jump(
                    caller_,
                    reinterpret_cast< intptr_t >( & to),
                    preserve_fpu() ) ) );
        flags_ |= flag_running;
        if ( from->do_unwind) throw forced_unwind();
        BOOST_ASSERT( from->data);
        return from->data;
    }
Ejemplo n.º 2
0
    R * yield_to_( Other * other, typename Other::param_type * to)
    {
        BOOST_ASSERT( ! is_complete() );
        BOOST_ASSERT( is_running() );
        BOOST_ASSERT( ! other->is_complete() );
        BOOST_ASSERT( ! other->is_running() );

        other->caller_ = caller_;
        flags_ &= ~flag_running;
        param_type * from(
            reinterpret_cast< param_type * >(
                callee_.jump(
                    other->callee_,
                    reinterpret_cast< intptr_t >( to),
                    preserve_fpu() ) ) );
        flags_ |= flag_running;
        if ( from->do_unwind) throw forced_unwind();
        BOOST_ASSERT( from->data);
        return from->data;
    }