made the OS cope with killed tasks

This commit is contained in:
Izaya 2017-07-31 09:39:42 +10:00
parent 5a6018ad5e
commit a95611806d
1 changed files with 3 additions and 3 deletions

View File

@ -32,13 +32,13 @@ do -- so local works
eq[#eq+1]={computer.pullSignal(p)} -- add the latest event to the eq
if #eq > 16 then
table.remove(eq,1) -- remove the earliest if the eq is full
for pid,proc in ipairs(tT) do
for pid,proc in pairs(tT) do
if proc.ep > 1 then
proc.ep = proc.ep - 1 -- decrement pointers for tasks to keep them on the same ones
end
end
end
for pid,proc in ipairs(tT) do
for pid,proc in pairs(tT) do
if coroutine.status(proc.c) == "dead" then
tT[pid] = nil
else
@ -89,7 +89,7 @@ do -- so local works
end
function os.tasks() -- returns a table of tasks running on the system
local t = {}
for k,v in ipairs(tT) do
for k,v in pairs(tT) do
t[k] = v.n
end
return t