示例#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
文件: link.cpp 项目: elrasguno/libten
void fn2()
{
    std::cout << "first time inside fn2()" << std::endl;
    ctx2.suspend();
    std::cout << "second time inside fn2(), returns to main()" << std::endl;
}