[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Can LuaCoco yield from outside of a Lua C Function?
- From: Mike Pall <mikelu-1109@...>
- Date: Fri, 30 Sep 2011 11:29:06 +0200
mitchell wrote:
> static VALUE l_yield(VALUE self, VALUE arg) {
> lua_pushsomething(L, RUBY2LUA(arg));
> lua_yield(L, 1); // coroutine.resume() should return the arg
> printf("This should not be called right away due to lua_yield()\n");
> ...
> }
The 'L' you're using here must be the lua_State for the coroutine,
not the main thread.
--Mike