diff options
author | Benoit Germain <bnt period germain arrobase gmail period com> | 2017-06-05 11:25:31 +0200 |
---|---|---|
committer | Benoit Germain <bnt period germain arrobase gmail period com> | 2017-06-05 11:25:31 +0200 |
commit | c2ca1fce531e29f8209660b18ef0a493722813f1 (patch) | |
tree | 3afa59fb910b2aaee79cbccc9a58fc961b3b8868 /tests/parallel_os_calls.lua | |
parent | 0ede50e2da00f2915ceb50184425c42bda83adfd (diff) | |
download | lanes-c2ca1fce531e29f8209660b18ef0a493722813f1.tar.gz lanes-c2ca1fce531e29f8209660b18ef0a493722813f1.tar.bz2 lanes-c2ca1fce531e29f8209660b18ef0a493722813f1.zip |
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
Diffstat (limited to 'tests/parallel_os_calls.lua')
-rw-r--r-- | tests/parallel_os_calls.lua | 13 |
1 files changed, 7 insertions, 6 deletions
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 @@ | |||
1 | local lanes = require "lanes".configure(1) | 1 | local lanes = require "lanes".configure{with_timers = false, nb_keepers = 1} |
2 | print( os.date()) | 2 | print( os.date()) |
3 | local linda = lanes.linda() | 3 | local linda = lanes.linda() |
4 | lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() | 4 | local l1 = lanes.gen("os,base", function() print "start sleeping" linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() |
5 | lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() | 5 | lanes.gen("os,base", function() print "start sleeping" linda:receive(9, "null") print("finished_sleeping " .. os.date()) end)() |
6 | lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() | 6 | lanes.gen("os,base", function() print "start sleeping" linda:receive(9, "null") print("finished_sleeping " .. os.date()) end)() |
7 | lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)() | 7 | lanes.gen("os,base", function() print "start sleeping" linda:receive(9, "null") print("finished_sleeping " .. os.date()) end)() |
8 | 8 | -- wait, else all lanes will get hard-cancelled at stat shutdown | |
9 | l1:join() | ||
9 | --[[ | 10 | --[[ |
10 | lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)() | 11 | lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)() |
11 | lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)() | 12 | lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)() |