diff options
Diffstat (limited to '')
-rw-r--r-- | tests/fifo.lua | 11 |
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 | ||
7 | require "lanes" | 7 | local lanes = require "lanes" |
8 | lanes.configure( 1) | ||
8 | 9 | ||
9 | local linda= lanes.linda() | 10 | local linda= lanes.linda() |
10 | local atomic_inc= lanes.genatomic( linda, "FIFO_n" ) | 11 | local 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 | } |
24 | end | 29 | end |
25 | 30 | ||