lean2/tests/lua/threads/th3.lua
Leonardo de Moura a30e02d862 fix(lua): redefine Lua 'print' function, and make sure it is thread safe
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-11 21:15:21 -08:00

12 lines
196 B
Lua

S1 = State()
S2 = State()
code = [[
id = ...
for i = 1, 10000 do
print("id: " .. id .. ", val: " .. i)
end
]]
T1 = thread(S1, code, 1)
T2 = thread(S2, code, 2)
T1:wait()
T2:wait()