From c2ca1fce531e29f8209660b18ef0a493722813f1 Mon Sep 17 00:00:00 2001 From: Benoit Germain <bnt period germain arrobase gmail period com> Date: Mon, 5 Jun 2017 11:25:31 +0200 Subject: Table transfer improvements * new API function lanes.register( "name", module) to manually register a module table after it was required * Transfering registered module tables will link the equivalent in the destination state instead of cloning it * bumped version to 3.11 --- tests/parallel_os_calls.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/parallel_os_calls.lua b/tests/parallel_os_calls.lua index b8cffa1..7119272 100644 --- a/tests/parallel_os_calls.lua +++ b/tests/parallel_os_calls.lua @@ -1,11 +1,12 @@ -local lanes = require "lanes".configure(1) +local lanes = require "lanes".configure{with_timers = false, nb_keepers = 1} print( os.date()) local linda = lanes.linda() -lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() -lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() -lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() -lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() - +local l1 = lanes.gen("os,base", function() print "start sleeping" linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() +lanes.gen("os,base", function() print "start sleeping" linda:receive(9, "null") print("finished_sleeping " .. os.date()) end)() +lanes.gen("os,base", function() print "start sleeping" linda:receive(9, "null") print("finished_sleeping " .. os.date()) end)() +lanes.gen("os,base", function() print "start sleeping" linda:receive(9, "null") print("finished_sleeping " .. os.date()) end)() +-- wait, else all lanes will get hard-cancelled at stat shutdown +l1:join() --[[ lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)() lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)() -- cgit v1.2.3-55-g6feb