diff --git a/argentum.cfg b/argentum.cfg index 110a22d..8702bc8 100644 --- a/argentum.cfg +++ b/argentum.cfg @@ -1,7 +1,7 @@ local agcfg = { ["halyde"] = { ["maindir"] = "", - ["version"] = "1.12.4", + ["version"] = "1.12.5", ["description"] = "A universal, customizable and feature-packed operating system for OpenComputers.", ["directories"] = { "halyde/apps", diff --git a/halyde/core/boot.lua b/halyde/core/boot.lua index 2e3fa59..6fa9749 100644 --- a/halyde/core/boot.lua +++ b/halyde/core/boot.lua @@ -1,7 +1,7 @@ local loadfile = ... local filesystem = loadfile("/halyde/lib/filesystem.lua")(loadfile) -_G._OSVERSION = "Halyde 1.12.4" +_G._OSVERSION = "Halyde 1.12.5" _G._OSLOGO = "" local handle, tmpdata = filesystem.open("/halyde/config/oslogo.ans", "r"), nil repeat diff --git a/halyde/core/cormgr.lua b/halyde/core/cormgr.lua index ff9d8b5..da4090f 100644 --- a/halyde/core/cormgr.lua +++ b/halyde/core/cormgr.lua @@ -2,16 +2,15 @@ _G.cormgr = {} _G.cormgr.corList = {} _G.cormgr.labelList = {} ---local ocelot = component.proxy(component.list("ocelot")()) - local component = import("component") local filesystem = import("filesystem") local json = import("json") local gpu = component.gpu +--local ocelot = component.ocelot function _G.cormgr.loadCoroutine(path,...) local args = {...} - local cor = coroutine.create(function() + local function corFunction() local result, errorMessage = xpcall(function(...) import(...) end, function(errorMessage) @@ -26,9 +25,22 @@ function _G.cormgr.loadCoroutine(path,...) end end --import(path, table.unpack(args)) - end) - table.insert(_G.cormgr.labelList, string.match(tostring(path), "([^/]+)%.lua$")) - table.insert(_G.cormgr.corList, cor) + end + cormgr.addCoroutine(corFunction, string.match(tostring(path), "([^/]+)%.lua$")) +end + +function _G.cormgr.addCoroutine(func, name) + local cor = coroutine.create(func) + table.insert(cormgr.corList, cor) + table.insert(cormgr.labelList, name) + return cor +end + +function _G.cormgr.removeCoroutine(name) + local index = table.find(cormgr.labelList, cor) + table.remove(cormgr.corList, index) + table.remove(cormgr.labelList, index) + coroutine.close(cor) end function handleError(errormsg) @@ -49,6 +61,8 @@ local function runCoroutines() end if coroutine.status(cormgr.corList[i]) == "dead" then table.remove(cormgr.corList, i) + table.remove(cormgr.labelList, i) + --ocelot.log("Removed coroutine") i = i - 1 end --computer.pullSignal(0)