lean2/tests/lua/th2.lua
Leonardo de Moura 9e445d1917 feat(lua): interrupt and sleep Lua APIs
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-14 10:04:32 -08:00

10 lines
149 B
Lua

S = State()
T = thread(S, [[
while true do
check_interrupted()
end
]])
sleep(100)
T:interrupt()
assert(not pcall(function() T:wait() end))