Add process.getActive method

This commit is contained in:
Robert Miles 2019-02-07 13:13:32 -05:00
parent dd2e8bafce
commit 14f4832b22
1 changed files with 10 additions and 1 deletions

View File

@ -81,11 +81,20 @@ end
function process.hasActive()
for i=0,(nextID-1) do
if process.get(i) and process.isRunning(i) then return true end
if process.get(i) and process.isRunning(i) then return true end
end
return false
end
function process.getActive()
ret = {}
for i=0,(nextID-1) do
if process.get(i) and process.isRunning(i) then table.insert(ret,i) end
end
return ret
end
local function apply_signal(proc,sig)
process.tick(proc,{"signal",sig})
if sig==process.signals.HALT and process.isRunning(proc.id) then