Trying to fix exposeENV with pseudoThreading

This commit is contained in:
Ryan Ward 2023-05-07 01:31:29 -04:00
parent e616b51d6f
commit ec9f7dec61
3 changed files with 8 additions and 4 deletions

View File

@ -54,6 +54,7 @@ local tab = [[_VERSION,io,os,require,load,debug,assert,collectgarbage,error,getf
tab = split(tab)
local id = 0
function multi:newSystemThread(name,func,...)
GLOBAL["$THREAD_NAME"] = name
GLOBAL["$__THREADNAME__"] = name
@ -69,6 +70,8 @@ function multi:newSystemThread(name,func,...)
thread = thread,
}
env.__env = env
if GLOBAL["__env"] then
for i,v in pairs(GLOBAL["__env"]) do
env[i] = v

View File

@ -107,6 +107,7 @@ local function INIT(thread)
end
function THREAD.exposeENV(name)
print("env",__env)
name = name or "__env"
local env = THREAD.getENV(name)
for i,v in pairs(env) do