1 function coroutine_test(a, b)
\r
4 local ret = system.suspend("suspend 1");
\r
5 println("the coroutine says ", ret);
\r
6 ret = system.suspend("suspend 2");
\r
7 println("the coroutine says: ", ret);
\r
8 ret = system.suspend("suspend 3");
\r
9 println("the coroutine says ", ret);
\r
13 local coro = system.newthread(coroutine_test);
\r
14 local susparam = coro.call("test","coroutine"); //starts the coroutine
\r
19 println("suspend passed [", susparam, "]")
\r
20 susparam = coro.wakeup("ciao "+i);
\r
22 }while(coro.getstatus()=="suspended")
\r
24 println("return passed [", susparam, "]")