On 31.07.2017 19:29, Gunnar Zötl wrote:
I use exactly this mechanism in my Lua environment. I would say it is a quite good mechanism.My idea for this was to install a hook, probably a count hook, that checks for a flag to see whether the thread has been aborted, and if it has, just raises an error. This would abort the vm at the earliest convenient opportunity, and also offer the ability to handle te abort from within lua (to do some cleanup or whatever).
What you might have to think about, do you want errors from your hook to be caught by pcall within a script or not.
Both is possible, you should just use one approach an stick to it. Probably in your scenario you don't want pcall to catch a error from the hook.