diff options
author | Benoit Germain <b n t DOT g e r m a i n AT g m a i l DOT c o m> | 2013-10-11 20:08:32 +0200 |
---|---|---|
committer | Benoit Germain <b n t DOT g e r m a i n AT g m a i l DOT c o m> | 2013-10-11 20:08:32 +0200 |
commit | 44540b9335f3bbd2f6fda3e13329b28ec76b6d7a (patch) | |
tree | 4b6d659c0976e58f6cbd907b673c2b9d769b9e88 /tests | |
parent | 938ee19cfcac09bfcfa1dd2a7861690436024410 (diff) | |
download | lanes-44540b9335f3bbd2f6fda3e13329b28ec76b6d7a.tar.gz lanes-44540b9335f3bbd2f6fda3e13329b28ec76b6d7a.tar.bz2 lanes-44540b9335f3bbd2f6fda3e13329b28ec76b6d7a.zip |
version 3.7.0
* fix lanes.threads() not being available in a lane where
lanes.configure() settings didn't contain track_lanes although the
initial configure() call did.
* require "lanes".configure() sequence is only necessary at the first
require "lanes".
* fix a crash at application shutdown where in some situations we could
deinitialize the protected allocator mutex while a lane was still using
it.
* fix timers broken by change 69
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fibonacci.lua | 5 | ||||
-rw-r--r-- | tests/irayo_recursive.lua | 6 | ||||
-rw-r--r-- | tests/recursive.lua | 6 |
3 files changed, 9 insertions, 8 deletions
diff --git a/tests/fibonacci.lua b/tests/fibonacci.lua index 5cdb4be..6dba1dd 100644 --- a/tests/fibonacci.lua +++ b/tests/fibonacci.lua | |||
@@ -12,8 +12,7 @@ | |||
12 | 12 | ||
13 | -- Need to say it's 'local' so it can be an upvalue | 13 | -- Need to say it's 'local' so it can be an upvalue |
14 | -- | 14 | -- |
15 | local lanes = require "lanes" | 15 | local lanes = require "lanes".configure{ nb_keepers =1, with_timers = false} |
16 | lanes.configure{ nb_keepers =1, with_timers = false} | ||
17 | 16 | ||
18 | local function WR(str) | 17 | local function WR(str) |
19 | io.stderr:write( str.."\n" ) | 18 | io.stderr:write( str.."\n" ) |
@@ -33,7 +32,7 @@ end | |||
33 | -- | 32 | -- |
34 | local function fib( n ) | 33 | local function fib( n ) |
35 | set_debug_threadname( "fib(" .. n .. ")") | 34 | set_debug_threadname( "fib(" .. n .. ")") |
36 | local lanes = require"lanes".configure() | 35 | local lanes = require"lanes" |
37 | -- | 36 | -- |
38 | local sum | 37 | local sum |
39 | local floor= assert(math.floor) | 38 | local floor= assert(math.floor) |
diff --git a/tests/irayo_recursive.lua b/tests/irayo_recursive.lua index f6fe87e..2f8b8a8 100644 --- a/tests/irayo_recursive.lua +++ b/tests/irayo_recursive.lua | |||
@@ -1,3 +1,4 @@ | |||
1 | local lanes = require "lanes".configure{ nb_keepers = 1, with_timers = false} | ||
1 | -- | 2 | -- |
2 | -- Bugs filed by irayo Jul-2008 | 3 | -- Bugs filed by irayo Jul-2008 |
3 | -- | 4 | -- |
@@ -8,10 +9,9 @@ local function recurse() | |||
8 | print("level "..i); | 9 | print("level "..i); |
9 | if i > 10 then return "finished" end | 10 | if i > 10 then return "finished" end |
10 | 11 | ||
11 | local lanes = require "lanes" | 12 | --local lanes = require "lanes" |
12 | lanes.configure{ nb_keepers = 1, with_timers = false} | ||
13 | 13 | ||
14 | local lane = lanes.gen( "*", { globals = { ["i"]= i + 1 } }, recurse ) () | 14 | local lane = lanes.gen( "base,string,lanes.core", { globals = { ["i"]= i + 1 } }, recurse ) () |
15 | return lane[1] | 15 | return lane[1] |
16 | end | 16 | end |
17 | 17 | ||
diff --git a/tests/recursive.lua b/tests/recursive.lua index 571fc1e..82a43b9 100644 --- a/tests/recursive.lua +++ b/tests/recursive.lua | |||
@@ -12,8 +12,10 @@ local function func( depth ) | |||
12 | end | 12 | end |
13 | 13 | ||
14 | local lanes = require "lanes" | 14 | local lanes = require "lanes" |
15 | -- lanes.configure() is gone after we call it... | 15 | -- lanes.configure() is available only at the first require() |
16 | lanes.configure() | 16 | if lanes.configure then |
17 | lanes = lanes.configure() | ||
18 | end | ||
17 | local lane= lanes.gen("*", func)( depth+1 ) | 19 | local lane= lanes.gen("*", func)( depth+1 ) |
18 | return lane[1] | 20 | return lane[1] |
19 | end | 21 | end |