From 242feeb342f68999b02c2b8dc4614abefdab8431 Mon Sep 17 00:00:00 2001 From: Benoit Germain <bnt.germain@gmail.com> Date: Mon, 10 Sep 2012 20:41:03 +0200 Subject: version 3.3.0 * lane.status can return "killed" if lane was forcefully killed with lanes:cancel() * lane:join(): return nil, "killed" if called on a killed lane. * lane[<n>]: produces [1] = nil, [2] = "killed" if the lane was killed * lane:join(): fixed an assertion in debug builds when joining a lane forcefully cancelled with lane:cancel( <x>, true). * indexing a lane with a string other than "join", "cancel" or "status" raises an error. * fixed configure() to correctly apply defaults when they are missing from the provided settings * added a shutdown_timeout to control the duration Lanes will wait for graceful termination of running lanes at application shutdown. Default is 0.25. Among other things, fixes issue #31. --- tests/fibonacci.lua | 6 +++--- tests/finalizer.lua | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/fibonacci.lua b/tests/fibonacci.lua index 452a770..48cd8d7 100644 --- a/tests/fibonacci.lua +++ b/tests/fibonacci.lua @@ -4,7 +4,7 @@ -- Parallel calculation of Fibonacci numbers -- -- A sample of task splitting like Intel TBB library does. --- +-- -- References: -- Intel Threading Building Blocks, 'test all' -- <http://shareit.intel.com/WikiHome/Articles/111111316> @@ -41,7 +41,7 @@ local function fib( n ) -- -- note that lanes is pulled in as upvalue, so we need package library to require internals properly -- (because lua51-lanes is always required internally if possible, which is necessary in that case) - local gen_f= lanes.gen( "package,string,io,math,debug", fib ) + local gen_f= lanes.gen( "*", fib ) local n1=floor(n/2) +1 local n2=floor(n/2) -1 + n%2 @@ -60,7 +60,7 @@ local function fib( n ) end io.stderr:write( "fib("..n..") = "..sum.."\n" ) - + return sum end diff --git a/tests/finalizer.lua b/tests/finalizer.lua index 6f186ab..dc9ed34 100644 --- a/tests/finalizer.lua +++ b/tests/finalizer.lua @@ -31,6 +31,7 @@ local function lane() io.stderr:write( "File "..FN.." created\n" ) if which==0 then + print "you loose" error("aa") -- exception here; the value needs NOT be a string end @@ -55,6 +56,7 @@ cleanup= function(err) end local _,err2= os.remove(FN) + print( "file removal result: ", tostring( err2)) assert(not err2) -- if this fails, it will be shown in the calling script -- as an error from the lane itself -- cgit v1.2.3-55-g6feb