|
Hi Viacheslav
But as you said, this "long running C function" could be a third-party one, thus there is no guarantee the flag will be checked, isn't it?While a Lua script executes Lua bytecode, it can be stopped by injecting a debug hook. But once it is inside a C function, standard or third-party, nothing at all can be done (short of killing the process). Why cannot we have an atomic flag in the Lua state structure that can be set whenever we want to abort execution, which can then be checked by potentially long running C functions? Not saying this is a panacea, but this is something which would simplify building a sandbox.
Regards, Tomás