Lua / Java / LuaJ - Handling or Interrupting Infinite Loops and Threads
问题 I'm using LuaJ to run user-created Lua scripts in Java. However, running a Lua script that never returns causes the Java thread to freeze. This also renders the thread uninterruptible. I run the Lua script with: JsePlatform.standardGlobals().loadFile("badscript.lua").call(); badscript.lua contains while true do end . I'd like to be able to automatically terminate scripts which are stuck in unyielding loops and also allow users to manually terminate their Lua scripts while they are running. I