[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua and Threads
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sun, 8 Jun 2003 17:31:37 -0300
>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 http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/ .