On Thu, Mar 31, 2022 at 11:18 AM Mike Pall <mikelj-2203@xxxxxxx> wrote:
Theo Schlossnagle wrote:
I have a (rather large) luajit runtime (on x86_64) and we implementcount
preempting by using timers on Linux to singal and lua_sethook with a
of 1.
Since XmiliaH tried for a repro (thanks!) in
https://github.com/LuaJIT/LuaJIT/issues/824
and was unaware of the precise restrictions for lua_sethook(),
I'll leave this here as well:
lua_sethook() (only when SETTING a count hook) is signal-safe, but NOT
thread-safe.
Your description sounds like you're aware of that. But please
double-check that the signal handler is called on the exact same
thread which is currently executing Lua code.