aboutsummaryrefslogtreecommitdiff
path: root/tests/fifo.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/fifo.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/fifo.lua b/tests/fifo.lua
index 898b04d..d8289c1 100644
--- a/tests/fifo.lua
+++ b/tests/fifo.lua
@@ -4,7 +4,8 @@
4-- Sample program for Lua Lanes 4-- Sample program for Lua Lanes
5-- 5--
6 6
7require "lanes" 7local lanes = require "lanes"
8lanes.configure( 1)
8 9
9local linda= lanes.linda() 10local linda= lanes.linda()
10local atomic_inc= lanes.genatomic( linda, "FIFO_n" ) 11local atomic_inc= lanes.genatomic( linda, "FIFO_n" )
@@ -18,8 +19,12 @@ local function FIFO()
18 return { 19 return {
19 -- Giving explicit 'nil' timeout allows numbers to be used as 'my_channel' 20 -- Giving explicit 'nil' timeout allows numbers to be used as 'my_channel'
20 -- 21 --
21 send= function(...) linda:send( nil, my_channel, ... ) end, 22 send= function(self, ...)
22 receive= function(timeout) linda:receive( timeout, my_channel ) end 23 linda:send( nil, my_channel, ... )
24 end,
25 receive = function(self, timeout)
26 linda:receive( timeout, my_channel )
27 end
23 } 28 }
24end 29end
25 30