lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi list !

I would like to create a coroutine and then continue execution in the coroutine so that the original calling code can yield.

Usage:

-- ...
co = coroutine.create(function()
  -- A
  -- co == main running code (B)
  scheduler:run()
end)

-- transform running thread into a coroutine and continue execution in "A"
-- B
coroutine.swap(co)

Is this possible ?

                                                               Gaspard