|
|
@ -157,11 +157,12 @@ function fillEnv(proc, uenv)
|
|
|
|
|
|
|
|
|
|
|
|
function ukitn.createProcess(path, ...)
|
|
|
|
function ukitn.createProcess(path, ...)
|
|
|
|
checkArg(1, path, 'string')
|
|
|
|
checkArg(1, path, 'string')
|
|
|
|
local env = mirror(envBase)
|
|
|
|
local env = {}
|
|
|
|
local fn, err = uloadfile(path, nil, env)
|
|
|
|
local fn, err = uloadfile(path, nil, env)
|
|
|
|
if not fn then return nil, err end
|
|
|
|
if not fn then return nil, err end
|
|
|
|
|
|
|
|
|
|
|
|
local newProc = co_create(fn)
|
|
|
|
local newProc = co_create(fn)
|
|
|
|
|
|
|
|
fillEnv(newProc, env)
|
|
|
|
processes[newProc] = { env = env, parent = proc, path = path }
|
|
|
|
processes[newProc] = { env = env, parent = proc, path = path }
|
|
|
|
runnable[newProc] = pack(...)
|
|
|
|
runnable[newProc] = pack(...)
|
|
|
|
return newProc
|
|
|
|
return newProc
|
|
|
|