void fn3( std::string const& str) { X x( str); intptr_t vp = gctx.suspend( value1); value1 = vp; BOOST_ASSERT( gctx.is_running() ); gctx.suspend(); }
void fn() { X x; for( int i = 0;; ++i) { std::cout << "fn(): " << i << std::endl; ctx.suspend(); } }
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"; }
void fn2() { std::cout << "first time inside fn2()" << std::endl; ctx2.suspend(); std::cout << "second time inside fn2(), returns to main()" << std::endl; }