lua-users home
lua-l archive

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


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