美丽黑米

文章
7
资源
0
加入时间
4年0月7天

Lua 中的协程

简单说下自己对Lua协程的心得。1、coroutine.create() 该方法是创建一个协程,参数为一个function,有一个类似thread的返回值。(协程处于挂起状态)example1:local f = function(num) print("this is a test coroutine") return coroutine.yield(1*nu...