lua-users home
lua-l archive

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


as a script termination only in extreme conditions - when you've
something doing coroutine.resume() you have to return to (dispatcher)
if you did not lua_resume() the function from which
you're yielding in the first place .. well, then you'll effectively
"terminate" your script with an error:
lua: attempt to yield across metamethod/C-call boundary

On Tue, Oct 31, 2006 at 10:40:37PM +0100, David Burgess wrote:
> The lua_yield question is:
> 
> If Ilua_yield from the C code, and then remove in references to the
> thread, will it collect OK?
> 
> That is, I was thinking of using lua_yield as a means of script
> termination.
> 
> In a Lua function
> 
> int neverreturn (lua_State* L)
> {
>   ...
>  return lua_yield(L,n);
> }
> 
> db