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-08-13 08:12:05 +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-08-13 08:12:05 +0200 |
commit | 7f7b29063d2f19a8bc2b229ae9b0ec82ce447cab (patch) | |
tree | 296e407a77e7e7f94add52967fe06e09aa7d58f3 /src/lanes.lua | |
parent | a6f76ba28d7e7e9d2d277a85dfd054cb70c02b69 (diff) | |
download | lanes-3.6.3.tar.gz lanes-3.6.3.tar.bz2 lanes-3.6.3.zip |
version 3.6.3v3.6.3
* lane:cancel(<negative-timeout>) only causes cancel_test() to return
true but won't interrupt execution of the lane during linda operations
* more explicit errors when trying to transfer unknown source functions
(with new configure option verbose_errors)
* default options wrap allocator around a mutex when run by LuaJIT
Diffstat (limited to 'src/lanes.lua')
-rw-r--r-- | src/lanes.lua | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lanes.lua b/src/lanes.lua index ac3da26..175002a 100644 --- a/src/lanes.lua +++ b/src/lanes.lua | |||
@@ -69,6 +69,7 @@ lanes.configure = function( _params) | |||
69 | shutdown_timeout = 0.25, | 69 | shutdown_timeout = 0.25, |
70 | with_timers = true, | 70 | with_timers = true, |
71 | track_lanes = nil, | 71 | track_lanes = nil, |
72 | verbose_errors = false, | ||
72 | -- LuaJIT provides a thread-unsafe allocator by default, so we need to protect it when used in parallel lanes | 73 | -- LuaJIT provides a thread-unsafe allocator by default, so we need to protect it when used in parallel lanes |
73 | protect_allocator = (jit and jit.version) and true or false | 74 | protect_allocator = (jit and jit.version) and true or false |
74 | } | 75 | } |
@@ -105,6 +106,14 @@ lanes.configure = function( _params) | |||
105 | track_lanes = function( _val) | 106 | track_lanes = function( _val) |
106 | -- track_lanes may be nil or boolean | 107 | -- track_lanes may be nil or boolean |
107 | return _val and type( _val) == "boolean" or true | 108 | return _val and type( _val) == "boolean" or true |
109 | end, | ||
110 | verbose_errors = function( _val) | ||
111 | -- verbose_errors may be nil or boolean | ||
112 | if _val then | ||
113 | return type( _val) == "boolean" | ||
114 | else | ||
115 | return true -- _val is either false or nil | ||
116 | end | ||
108 | end | 117 | end |
109 | } | 118 | } |
110 | 119 | ||
@@ -138,7 +147,7 @@ lanes.configure = function( _params) | |||
138 | assert( type( core)=="table") | 147 | assert( type( core)=="table") |
139 | 148 | ||
140 | -- 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 | 149 | -- 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 |
141 | if core.configure then core.configure( _params.nb_keepers, _params.on_state_create, _params.shutdown_timeout, _params.track_lanes, _params.protect_allocator) end | 150 | if core.configure then core.configure( _params.nb_keepers, _params.on_state_create, _params.shutdown_timeout, _params.track_lanes, _params.protect_allocator, _params.verbose_errors) end |
142 | 151 | ||
143 | local thread_new = assert( core.thread_new) | 152 | local thread_new = assert( core.thread_new) |
144 | 153 | ||