aboutsummaryrefslogtreecommitdiff
path: root/tests/fifo.lua
diff options
context:
space:
mode:
authorBenoit Germain <b n t DOT g e r m a i n AT g m a i l DOT c o m>2013-08-13 08:12:05 +0200
committerBenoit Germain <b n t DOT g e r m a i n AT g m a i l DOT c o m>2013-08-13 08:12:05 +0200
commit7f7b29063d2f19a8bc2b229ae9b0ec82ce447cab (patch)
tree296e407a77e7e7f94add52967fe06e09aa7d58f3 /tests/fifo.lua
parenta6f76ba28d7e7e9d2d277a85dfd054cb70c02b69 (diff)
downloadlanes-3.6.3.tar.gz
lanes-3.6.3.tar.bz2
lanes-3.6.3.zip
version 3.6.3v3.6.3
* lane:cancel(<negative-timeout>) only causes cancel_test() to return true but won't interrupt execution of the lane during linda operations * more explicit errors when trying to transfer unknown source functions (with new configure option verbose_errors) * default options wrap allocator around a mutex when run by LuaJIT
Diffstat (limited to 'tests/fifo.lua')
-rw-r--r--tests/fifo.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/fifo.lua b/tests/fifo.lua
index b68d8a4..47db4c9 100644
--- a/tests/fifo.lua
+++ b/tests/fifo.lua
@@ -4,10 +4,9 @@
4-- Sample program for Lua Lanes 4-- Sample program for Lua Lanes
5-- 5--
6 6
7local lanes = require "lanes" 7local lanes = require "lanes".configure{shutdown_timeout=3,with_timers=true}
8lanes.configure()
9 8
10local linda= lanes.linda() 9local linda= lanes.linda( "atom")
11local atomic_inc= lanes.genatomic( linda, "FIFO_n" ) 10local atomic_inc= lanes.genatomic( linda, "FIFO_n" )
12 11
13assert( atomic_inc()==1 ) 12assert( atomic_inc()==1 )
@@ -46,3 +45,5 @@ print( B:receive( 2.0 ) )
46-- Note: A and B can be passed between threads, or used as upvalues 45-- Note: A and B can be passed between threads, or used as upvalues
47-- by multiple threads (other parts will be copied but the 'linda' 46-- by multiple threads (other parts will be copied but the 'linda'
48-- handle is shared userdata and will thus point to the single place) 47-- handle is shared userdata and will thus point to the single place)
48lanes.timer_lane:cancel()
49lanes.timer_lane:join() \ No newline at end of file