aboutsummaryrefslogtreecommitdiff
path: root/src/lanes.lua
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2011-11-14 19:41:28 +0100
committerBenoit Germain <bnt.germain@gmail.com>2011-11-14 19:41:28 +0100
commit87431bcc0ece1eaf9305593223bb0c5145004044 (patch)
treee1a76ea727e8019d3c26c4829dbb95253dd7e1f6 /src/lanes.lua
parent1d2b45823fd2a13761bd2d19b1b5a1e8bb11f7b9 (diff)
downloadlanes-87431bcc0ece1eaf9305593223bb0c5145004044.tar.gz
lanes-87431bcc0ece1eaf9305593223bb0c5145004044.tar.bz2
lanes-87431bcc0ece1eaf9305593223bb0c5145004044.zip
* removed packagepath and packagecpath options, replaced by a package table, whose fields path, cpath, loaders, preload are transfered
* code cleanup to facilitate transition between WIN32 and PTHREAD impleentations * tentative fix for desinit crashes when free running lanes are killed at process shutdown
Diffstat (limited to 'src/lanes.lua')
-rw-r--r--src/lanes.lua13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/lanes.lua b/src/lanes.lua
index 005ce28..6ba0ef3 100644
--- a/src/lanes.lua
+++ b/src/lanes.lua
@@ -214,7 +214,7 @@ local function gen( ... )
214 end 214 end
215 end 215 end
216 216
217 local prio, cs, g_tbl, packagepath, packagecpath, required 217 local prio, cs, g_tbl, package_tbl, required
218 218
219 for k,v in pairs(opt) do 219 for k,v in pairs(opt) do
220 if k=="priority" then prio= v 220 if k=="priority" then prio= v
@@ -224,10 +224,8 @@ local function gen( ... )
224 type(v)=="number" and v or 224 type(v)=="number" and v or
225 error( "Bad cancelstep: "..tostring(v), lev ) 225 error( "Bad cancelstep: "..tostring(v), lev )
226 elseif k=="globals" then g_tbl= v 226 elseif k=="globals" then g_tbl= v
227 elseif k=="packagepath" then 227 elseif k=="package" then
228 packagepath = (type( v) == "string") and v or error( "Bad packagepath: " .. tostring( v), lev) 228 package_tbl = (type( v) == "table") and v or error( "Bad package: " .. tostring( v), lev)
229 elseif k=="packagecpath" then
230 packagecpath = (type( v) == "string") and v or error( "Bad packagecpath: " .. tostring( v), lev)
231 elseif k=="required" then 229 elseif k=="required" then
232 required= (type( v) == "table") and v or error( "Bad required: " .. tostring( v), lev) 230 required= (type( v) == "table") and v or error( "Bad required: " .. tostring( v), lev)
233 --.. 231 --..
@@ -236,12 +234,11 @@ local function gen( ... )
236 end 234 end
237 end 235 end
238 236
239 if not packagepath then packagepath = package.path end 237 if not package_tbl then package_tbl = package end
240 if not packagecpath then packagecpath = package.cpath end
241 -- Lane generator 238 -- Lane generator
242 -- 239 --
243 return function(...) 240 return function(...)
244 return thread_new( func, libs, cs, prio, g_tbl, packagepath, packagecpath, required, ...) -- args 241 return thread_new( func, libs, cs, prio, g_tbl, package_tbl, required, ...) -- args
245 end 242 end
246end 243end
247 244