From 6d8f40a1232b425add7b1b54df14d341382e6fab Mon Sep 17 00:00:00 2001 From: Ocawesome101 Date: Mon, 14 Sep 2026 19:20:07 -0400 Subject: [PATCH] Redo my old improper fix for #3580 (undoes 655f36e) `process.removeHandle(mt.process, t)` was incorrect argument order and causing weird issues with the `thread` API. The new fix fixes a check that was the actual root cause of the issue, by acknowledging the fact that `process.info()` returns a new table every time--but for a given process, the `data` field of this table will always be the same. --- .../opencomputers/loot_disks/openos/lib/thread.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/resources/data/opencomputers/opencomputers/loot_disks/openos/lib/thread.lua b/src/main/resources/data/opencomputers/opencomputers/loot_disks/openos/lib/thread.lua index f019abe1d9..d4e69fcaef 100644 --- a/src/main/resources/data/opencomputers/opencomputers/loot_disks/openos/lib/thread.lua +++ b/src/main/resources/data/opencomputers/opencomputers/loot_disks/openos/lib/thread.lua @@ -107,7 +107,7 @@ function box_thread:attach(parent) local proc = process.info(parent) local mt = assert(getmetatable(self), "thread panic: no metadata") if not proc then return nil, "thread failed to attach, process not found" end - if mt.attached == proc then return self end -- already attached + if mt.attached.data == proc.data then return self end -- already attached -- remove from old parent local waiting_handler @@ -265,7 +265,6 @@ function thread.create(fp, ...) local old_status = t:status() mt.__status = "dead" process.removeHandle(t, mt.attached) - process.removeHandle(mt.process, t) if old_status ~= "dead" then event.push("thread_exit") end