aboutsummaryrefslogtreecommitdiff
path: root/tests/appendud.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/appendud.lua')
-rw-r--r--tests/appendud.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/appendud.lua b/tests/appendud.lua
index afea0e9..65d0798 100644
--- a/tests/appendud.lua
+++ b/tests/appendud.lua
@@ -31,18 +31,18 @@ local _ud = {
31 31
32 32
33function appendud(tab, ud) 33function appendud(tab, ud)
34io.stderr:write "Starting" 34 io.stderr:write "Starting"
35 tab:beginupdate() set_finalizer( function() tab:endupdate() end ) 35 tab:beginupdate() set_finalizer( function() tab:endupdate() end )
36 ud:lock() set_finalizer( function() ud:unlock() end ) 36 ud:lock() set_finalizer( function() ud:unlock() end )
37 for i = 1,#ud do 37 for i = 1,#ud do
38 tab[#tab+1] = ud[i] 38 tab[#tab+1] = ud[i]
39 end 39 end
40io.stderr:write "Ending" 40 io.stderr:write "Ending"
41 return tab -- need to return 'tab' since we're running in a separate thread 41 return tab -- need to return 'tab' since we're running in a separate thread
42 -- ('tab' is passed over lanes by value, not by reference) 42 -- ('tab' is passed over lanes by value, not by reference)
43end 43end
44 44
45local t,err= lanes.gen( appendud )( _tab, _ud ) -- create & launch a thread 45local t,err= lanes.gen( "io", appendud )( _tab, _ud ) -- create & launch a thread
46assert(t) 46assert(t)
47assert(not err) 47assert(not err)
48 48