From a246ebcffcc444232f6433b9ac38aa921c332540 Mon Sep 17 00:00:00 2001 From: Jane Roxanne Date: Mon, 9 Mar 2020 22:34:45 -0500 Subject: [PATCH] oops forgot some shit --- installer_dat/package_list.lua | 5 ++ lib/core_thd/init.lua | 92 ---------------------------------- 2 files changed, 5 insertions(+), 92 deletions(-) delete mode 100644 lib/core_thd/init.lua diff --git a/installer_dat/package_list.lua b/installer_dat/package_list.lua index 0d2489c..66c3671 100644 --- a/installer_dat/package_list.lua +++ b/installer_dat/package_list.lua @@ -1,5 +1,10 @@ { {name="zlan", cat="util", path="lib/util_zlan.zy2l"}, + {name="cpio", cat="util", path="lib/util_cpio.zy2l"}, + {name="urf", cat="util", path="lib/util_urf.zy2l"}, + {name="vcomponent", cat="util", path="lib/util_vcomponent.zy2l"}, + {name="oefiv2", cat="util", path="mods/util_oefiv2.zy2m"}, + {name="oefiv1", cat="util", path="mods/util_oefiv1.zy2m"}, {name="openos", cat="loader", path="mods/loader_openos.zy2m"}, {name="fuchas", cat="loader", path="mods/loader_fuchas.zy2m"}, --{name="tsuki", cat="loader", path="mods/loader_tsuki.zy2m"}, diff --git a/lib/core_thd/init.lua b/lib/core_thd/init.lua deleted file mode 100644 index 7fb19df..0000000 --- a/lib/core_thd/init.lua +++ /dev/null @@ -1,92 +0,0 @@ -local thd = {} - -local threads = {} - -local idx = 1 - -local computer = computer -local unpack = unpack or table.unpack -local coroutine = coroutine -local c_create = coroutine.create -local c_yield = coroutine.yield -local c_resume = coroutine.resume -local c_status = coroutine.status - -function thd.add(name, func) - local t = assert(c_create(func)) - --component.proxy(component.list("sandbox")()).debug_log(name, t, func) - threads[#threads+1] = {name, t, {}, 0, ".+"} - threads[t] = threads[#threads] -end - -local sigs = {} -local ps = computer.pullSignal -function thd.autosleep() - local msleep = math.huge - for i=1, #threads do - if (threads[i][4] and threads[i][4] < msleep) then - msleep = threads[i][4] - end - end - local rsleep = msleep-computer.uptime() - if (rsleep < 0 or #sigs > 0) then - rsleep = 0 - end - local sig = {ps(rsleep)} - if (#sigs > 0) then - if (#sig > 0) then - sigs[#sigs+1] = sig - end - sig = sigs[1] - table.remove(sigs, 1) - end - return sig -end - -local last_sig = {} - -function thd.run() - last_sig = thd.autosleep() - for i=1, #threads do - if (threads[i][4] <= computer.uptime() or #last_sig > 0) then - if (c_status(threads[i][2]) ~= "running") then - local er, dl = c_resume(threads[i][2], unpack(last_sig)) - if (not er) then error(threads[i][1]..": "..dl) end - if (dl == "k") then - threads[i][6] = true - end - dl = computer.uptime() + (dl or math.huge) - threads[i][4] = dl - sigs[#sigs+1] = {ps(0)} - end - end - end - local t = {} - for i=1, #threads do - local v = threads[i] - if (c_status(v[2]) ~= "dead" and not v[6]) then - t[#t+1] = v - t[v[2]] = v - end - end - threads = t - return #threads > 0 -end - -function thd.kill(i) - threads[i][6] = true -end - -function thd.sched_end() - return #threads == idx -end - -function thd.get_threads() - return threads -end - -function computer.pullSignal(t) - return c_yield(t) -end - -return thd \ No newline at end of file