Пример #1
0
void fn3( std::string const& str)
{
    X x( str);
    intptr_t vp = gctx.suspend( value1);
    value1 = vp;
	BOOST_ASSERT( gctx.is_running() );
    gctx.suspend();
}
Пример #2
0
void fn()
{
    X x;

    for( int i = 0;; ++i)
    {
        std::cout << "fn(): " << i << std::endl;
        ctx.suspend();
    }
}
Пример #3
0
void fn2() {
    std::cout << "inside function fn2(): fn2() returns return to fn()" << std::endl;
 //   ctx.resume();
    ctx2.suspend();
    std::cout << "finish fn2(), returning back to fn\n";
}
Пример #4
0
void fn2()
{
    std::cout << "first time inside fn2()" << std::endl;
    ctx2.suspend();
    std::cout << "second time inside fn2(), returns to main()" << std::endl;
}