Working on 16.0.0 #53

Merged
rayaman merged 120 commits from v16.0.0 into master 2024-02-25 00:00:51 -05:00
2 changed files with 10 additions and 8 deletions
Showing only changes of commit 946217310f - Show all commits

View File

@ -1226,7 +1226,9 @@ end
function multi.hold(func,opt)
if thread.isThread() then return thread.hold(func, opt) end
local proc = multi.getCurrentTask()
if proc then
proc:Pause()
end
local rets
thread:newThread("Hold_func",function()
rets = {thread.hold(func,opt)}
@ -1234,7 +1236,9 @@ function multi.hold(func,opt)
while rets == nil do
multi:uManager()
end
if proc then
proc:Resume()
end
return multi.unpack(rets)
end

View File

@ -48,14 +48,12 @@ local function INIT(__GlobalLinda, __SleepingLinda, __StatusLinda, __Console)
end
function THREAD.waitFor(name)
local function wait()
local multi, thread = require("multi"):init()
return multi.hold(function()
math.randomseed(os.time())
__SleepingLinda:receive(.001, "__non_existing_variable")
end
repeat
wait()
until __GlobalLinda:get(name)
return __GlobalLinda:get(name)
end)
end
function THREAD.getCores()