lua-users home
lua-l archive

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



Why not set the hook before you start the script (from the same thread thatthe script runs in, I mean)?

Because it will probably slow down the script, even if the hook only
checks a flag. Plus you'll have to store the flag somewhere that the
main application can raise it when the user presses 'stop' or something.

So, I think it's easier simply to set the hook at the momemnt the thread
needs to be interrupted.

You're right about the possible slow down, of course. I didn't know it was safe to call lua_sethook from another (OS) thread while a script was running. This is not the same situation as in the vanilla Lua interpreter, or is it?

Ashwin.
--
no signature is a signature.