lua-users home
lua-l archive

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

>The trick we "recommend" is for your interrupt to set a count hook.
>All that your iterrupt does is to set this hook (i.e., a simple call
>to lua_sethook).  This operation is fairly simple and reasonably safe
>to perform at any point in the Lua code.  The real work is done by the
>hook, when it is called by Lua. (lua.c uses this trick to interrupt Lua
>when the user hits ^C.)

This technique is also used in my alarm library, which I have updated for
Lua 5.0. See lalarm at .