co2 = coroutine.create(
function()
for i=1,10 do
print(i)
if i == 3 then
print(coroutine.status(co2))
print(coroutine.running())
end
coroutine.yield()
end
end
)
coroutine.resume(co2)
coroutine.resume(co2)
coroutine.resume(co2)
print(coroutine.status(co2))
print(coroutine.running())
该段代码来自于lua某网站的教程,教程中输出的结果是:
running
thread: 0x7fb801c05868 false
suspended
thread: 0x7fb801c04c88 true
我输出的结果是:
running
thread: 00C68600
suspended
nil
编辑器用的是SciTE,版本为5.1