lua-users home
lua-l archive

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


[Roberto Ierusalimschy <roberto@inf.puc-rio.br>]
> > Is it possible to yield from the opcode count hook under Lua 5.0 beta?
> 
> Yes. Just finish your hook with 
> 
>   lua_yield(L, 0);

And this will never cause the "attempt to yield across metamethod/C-call
boundary" error (that can happen in lua_yield() if L->nCcalls > 0? 

It seems like there are some conditions that this might not work under
(but perhaps I misunderstand the source).  In particular, if the hook
happens while a metamethod is running or inside of lua code called
from c code from lua code, will it happily yield or will there be an
error.

Brian