[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua and Threads
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sat, 07 Jun 2003 16:46:23 +0000
> i am suspecting that i cannot do this.
Sure you cannot.
> if anyone can offer any assistance or advice then please let me know.
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.)