diff options
-rw-r--r-- | src/lanes.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lanes.lua b/src/lanes.lua index 26237d5..a621dd4 100644 --- a/src/lanes.lua +++ b/src/lanes.lua | |||
@@ -62,7 +62,7 @@ lanes.configure = function( _params) | |||
62 | local tostring = assert( tostring) | 62 | local tostring = assert( tostring) |
63 | local error = assert( error) | 63 | local error = assert( error) |
64 | 64 | ||
65 | local default_params = { nb_keepers = 1, on_state_create = nil, shutdown_timeout = 0.25, with_timers = true} | 65 | local default_params = { nb_keepers = 1, on_state_create = nil, shutdown_timeout = 0.25, with_timers = true, track_lanes = nil} |
66 | local param_checkers = | 66 | local param_checkers = |
67 | { | 67 | { |
68 | nb_keepers = function( _val) | 68 | nb_keepers = function( _val) |
@@ -80,6 +80,10 @@ lanes.configure = function( _params) | |||
80 | shutdown_timeout = function( _val) | 80 | shutdown_timeout = function( _val) |
81 | -- nb_keepers should be a number >= 0 | 81 | -- nb_keepers should be a number >= 0 |
82 | return type( _val) == "number" and _val >= 0 | 82 | return type( _val) == "number" and _val >= 0 |
83 | end, | ||
84 | track_lanes = function( _val) | ||
85 | -- track_lanes may be nil or boolean | ||
86 | return _val and type( _val) == "boolean" or true | ||
83 | end | 87 | end |
84 | } | 88 | } |
85 | 89 | ||
@@ -113,7 +117,7 @@ lanes.configure = function( _params) | |||
113 | assert( type( core)=="table") | 117 | assert( type( core)=="table") |
114 | 118 | ||
115 | -- configure() is available only the first time lanes.core is required process-wide, and we *must* call it to have the other functions in the interface | 119 | -- configure() is available only the first time lanes.core is required process-wide, and we *must* call it to have the other functions in the interface |
116 | if core.configure then core.configure( _params.nb_keepers, _params.on_state_create, _params.shutdown_timeout) end | 120 | if core.configure then core.configure( _params.nb_keepers, _params.on_state_create, _params.shutdown_timeout, _params.track_lanes) end |
117 | 121 | ||
118 | local thread_new = assert( core.thread_new) | 122 | local thread_new = assert( core.thread_new) |
119 | 123 | ||
@@ -631,6 +635,7 @@ end | |||
631 | lanes.linda = core.linda | 635 | lanes.linda = core.linda |
632 | lanes.cancel_error = core.cancel_error | 636 | lanes.cancel_error = core.cancel_error |
633 | lanes.nameof = core.nameof | 637 | lanes.nameof = core.nameof |
638 | lanes.threads = core.threads | ||
634 | lanes.timer = timer | 639 | lanes.timer = timer |
635 | lanes.timers = timers | 640 | lanes.timers = timers |
636 | lanes.genlock = genlock | 641 | lanes.genlock = genlock |