aboutsummaryrefslogtreecommitdiff
path: root/src/lanes.lua
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2011-03-30 19:16:39 +0200
committerBenoit Germain <bnt.germain@gmail.com>2011-03-30 19:44:17 +0200
commit2d5d798c24286f10c1bffd5ea4ac466c2c3a12fa (patch)
tree17cdd59743fde2e33361509e5e5b847c0b816926 /src/lanes.lua
parent5499ec1a61be9797c57834618a49731952b1d212 (diff)
downloadlanes-2d5d798c24286f10c1bffd5ea4ac466c2c3a12fa.tar.gz
lanes-2d5d798c24286f10c1bffd5ea4ac466c2c3a12fa.tar.bz2
lanes-2d5d798c24286f10c1bffd5ea4ac466c2c3a12fa.zip
New features
* linda honors __tostring and __concat * new accessor linda:keys(), to retrieve the list of keys with pending data inside a linda * new lanes options packagepath and packagecpath, in case one needs to set them differently than the default
Diffstat (limited to '')
-rw-r--r--src/lanes.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lanes.lua b/src/lanes.lua
index 05c2ff1..252d151 100644
--- a/src/lanes.lua
+++ b/src/lanes.lua
@@ -204,7 +204,7 @@ function gen( ... )
204 end 204 end
205 end 205 end
206 206
207 local prio, cs, g_tbl 207 local prio, cs, g_tbl, packagepath, packagecpath
208 208
209 for k,v in pairs(opt) do 209 for k,v in pairs(opt) do
210 if k=="priority" then prio= v 210 if k=="priority" then prio= v
@@ -213,6 +213,8 @@ function gen( ... )
213 type(v)=="number" and v or 213 type(v)=="number" and v or
214 error( "Bad cancelstep: "..tostring(v), lev ) 214 error( "Bad cancelstep: "..tostring(v), lev )
215 elseif k=="globals" then g_tbl= v 215 elseif k=="globals" then g_tbl= v
216 elseif k=="packagepath" then packagepath= v
217 elseif k=="packagecpath" then packagecpath= v
216 --.. 218 --..
217 elseif k==1 then error( "unkeyed option: ".. tostring(v), lev ) 219 elseif k==1 then error( "unkeyed option: ".. tostring(v), lev )
218 else error( "Bad option: ".. tostring(k), lev ) 220 else error( "Bad option: ".. tostring(k), lev )
@@ -222,7 +224,7 @@ function gen( ... )
222 -- Lane generator 224 -- Lane generator
223 -- 225 --
224 return function(...) 226 return function(...)
225 return thread_new( func, libs, cs, prio, g_tbl, ...) -- args 227 return thread_new( func, libs, cs, prio, g_tbl, packagepath, packagecpath, ...) -- args
226 end 228 end
227end 229end
228 230
@@ -237,6 +239,8 @@ linda = mm.linda
237 239
238 240
239---=== Timers ===--- 241---=== Timers ===---
242local want_timers = true
243if want_timers then
240 244
241local timer_gateway= assert( mm.timer_gateway ) 245local timer_gateway= assert( mm.timer_gateway )
242-- 246--
@@ -452,6 +456,7 @@ function timer( linda, key, a, period )
452 timer_gateway:send( TGW_KEY, linda, key, wakeup_at, period ) 456 timer_gateway:send( TGW_KEY, linda, key, wakeup_at, period )
453end 457end
454 458
459end -- want_timers
455 460
456---=== Lock & atomic generators ===--- 461---=== Lock & atomic generators ===---
457 462