24 lines
450 B
Lua
24 lines
450 B
Lua
package.path="?.lua;?/init.lua;?.lua;"..package.path
|
|
local multi, thread = require("multi"):init()
|
|
func = thread:newFunction(function()
|
|
thread.sleep(math.random(1,3))
|
|
local t = math.random(1,10)
|
|
return t
|
|
end)
|
|
func().connect(function(a)
|
|
print(a)
|
|
end)
|
|
func().connect(function(a)
|
|
print(a)
|
|
end)
|
|
func().connect(function(a)
|
|
print(a)
|
|
end)
|
|
func().connect(function(a)
|
|
print(a)
|
|
end)
|
|
func().connect(function(a)
|
|
print(a)
|
|
end)
|
|
--os.exit()
|
|
multi:mainloop() |