lua-users home
lua-l archive

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


Ok, Thank you for idea:)
https://github.com/effil/effil/issues/78

Ilia

29 сент. 2017 г., в 22:44, Hisham <h@hisham.hm> написал(а):

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!