multi/examples/lanesintergratetest5.lua
Ryan 7601fc636d Updated to 1.8.0
Added:
SystemThreadedBenchmark
SystemThreadedQueue
Fixed a bunch of bugs in the intergrations and regular multi objects
Fixed Error management in threads
All errors trigger the multi.OnError connection
Module creation support improved
added more examples
added Type to threaded objects
2017-06-28 22:40:04 -04:00

29 lines
634 B
Lua

package.path="?/init.lua;"..package.path -- slightly different usage of the code
local GLOBAL,sThread=require("multi.intergration.lanesManager").init()
queue=multi:newSystemThreadedQueue("QUEUE")
queue:push(1)
queue:push(2)
queue:push(3)
queue:push(4)
queue:push(5)
queue:push(6)
multi:newSystemThread("STHREAD_1",function()
queue=sThread.waitFor("QUEUE"):init()
GLOBAL["QUEUE"]=nil
data=queue:pop()
while data do
print(data)
data=queue:pop()
end
end)
multi:newThread("THREAD_1",function()
while true do
if GLOBAL["QUEUE"]==nil then
print("Deleted a Global!")
break
end
thread.skip(1)
end
end)
multi:mainloop()