29 сент. 2017 г., в 22:44, Hisham <email@example.com
Well, since you replied on-list, I'll move the conversation on-list. :)
Wouldn't it be possible to leave the hook disabled by default and only enable it
when a thread calls thr:pause()? lua_sethook is async-safe so you'd only need
a lock to make sure that the state is not lua_close'd in the meantime (and not
to lock the actual execution of the thread).
(The lua.c interpreter does a roughly similar thing to forward a
cancellation request via the signal handler.)
Just throwing an idea out there!