0

我有函数,它在 LuaRuntime 线程中运行一些未知代码,例如

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

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

代码在哪里

a = 1
while a == 1 do end

有什么办法可以停止线程?我阅读了关于在不定式循环条件下检查变量的信息,但代码未知,我不能保证会有这样的检查。

4

0 回答 0