diff options
Diffstat (limited to 'tests/appendud.lua')
| -rw-r--r-- | tests/appendud.lua | 6 |
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 | ||
| 33 | function appendud(tab, ud) | 33 | function appendud(tab, ud) |
| 34 | io.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 |
| 40 | io.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) |
| 43 | end | 43 | end |
| 44 | 44 | ||
| 45 | local t,err= lanes.gen( appendud )( _tab, _ud ) -- create & launch a thread | 45 | local t,err= lanes.gen( "io", appendud )( _tab, _ud ) -- create & launch a thread |
| 46 | assert(t) | 46 | assert(t) |
| 47 | assert(not err) | 47 | assert(not err) |
| 48 | 48 | ||
