summaryrefslogtreecommitdiff
path: root/tests/parallel_os_calls.lua
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2012-09-26 21:22:30 +0200
committerBenoit Germain <bnt.germain@gmail.com>2012-09-26 21:22:30 +0200
commitbba4ecea15320dfbf8edf35f7361de374d895ace (patch)
tree73bd0bfd29d2c4dbfe3a46681b0e3b2261352207 /tests/parallel_os_calls.lua
parent282f59ca02d1d1f304b9126b84a8b1427caf3172 (diff)
downloadlanes-bba4ecea15320dfbf8edf35f7361de374d895ace.tar.gz
lanes-bba4ecea15320dfbf8edf35f7361de374d895ace.tar.bz2
lanes-bba4ecea15320dfbf8edf35f7361de374d895ace.zip
version 3.4.0
* new method linda:dump() that outputs the full contents of a linda as a table, also linked to __towatch for Decoda support * linda:receive() API change! * instead of [val, key], linda:receive( timeout, key) returns [key, val] * instead of [val, [...]], linda:receive( timeout, linda.batched key) returns [key, val[, ...]] this is to unify the return values of regular and batched mode, and to be able to tell when batched mode is interrupted by a lane cancellation * fixed Lua 5.2 build to take into account the "loaders"->"searchers" name change in 'package' module. * a bit of html cleanup and added some infos in the documentation regarding the Lanes internals
Diffstat (limited to 'tests/parallel_os_calls.lua')
-rw-r--r--tests/parallel_os_calls.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/parallel_os_calls.lua b/tests/parallel_os_calls.lua
new file mode 100644
index 0000000..b8cffa1
--- /dev/null
+++ b/tests/parallel_os_calls.lua
@@ -0,0 +1,14 @@
1local lanes = require "lanes".configure(1)
2print( os.date())
3local linda = lanes.linda()
4lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)()
5lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)()
6lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)()
7lanes.gen("os,base", function() linda:receive(10, "null") print("finished_sleeping " .. os.date()) end)()
8
9--[[
10lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)()
11lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)()
12lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)()
13lanes.gen("os,base", function() os.execute('sleep 10 && echo finished_sleeping') print( os.date()) end)()
14]]