Stopping infinitive loop in lupa in thread

101 Views Asked by At

I have function, which run some unknown code in LuaRuntime in thread, ex

def lua(code):
    lua = LuaRuntime()
    lua.execute(code)

def lua_in_thread(code):
    t = threading.Thread(target = lua, args = (code,))
    t.start()
    return t

Where code is

a = 1
while a == 1 do end

Is there any way to stop the thread? I read about check for variable in condition of infinitive loop, but there code unknown, and I can not guarantee that there will be such a check.

0

There are 0 best solutions below