This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Hiran's profile picture

coroutine.status problem

Started by Hiran, 06 October 2014 - 06:42 PM
Hiran #1
Posted 06 October 2014 - 08:42 PM
Im fighting with multishell and something unexpected is happening. Im checking my only coroutine created with multishell "launchProcess"

local cor = tProcess.co
print (cor)
print (coroutine.status(cor))
first print shows "thread:" and HEX code of this coroutine, but second shows "dead". Its my only coroutine so its a bit weird, as "dead" should be shown only if that coroutine ended, either with or without error. Can someone explain why is this happening and how to fix this?

http://pastebin.com/TYQmDvHK

Here you have full multishell, but this file is heavy under construction, so many things will change within it.
MKlegoman357 #2
Posted 07 October 2014 - 02:00 PM
'launchProcess' runs the coroutine at the end of it using the 'resumeProcess' function so that might be your problem. What function/program does that coroutine run?

EDIT: Also, where are you putting your code (the one in the OP)?
Edited on 07 October 2014 - 12:01 PM
Hiran #3
Posted 07 October 2014 - 03:59 PM
These 3 lines were in the cullProcess function. I created function that's called manually and it still shows that all the coroutines are "dead".

function multishell.printStatus(ID)
   print (coroutine.status(tProcesses[ID].co))
end
When i enter tab with coroutine that "ended" it shows error, so everything as expected. But most recent version of my multishell is created in a way that doesnt allow to end multishell tab with id 1, but when i call function printStatus it shows "dead"
Hiran #4
Posted 07 October 2014 - 08:22 PM
Problem solved
I used this:
http://www.computercraft.info/forums2/index.php?/topic/20232-bios-level-coroutine-override/
to override bios, but for some odd reason reverting back coroutine.status didn't work when i used os.run() to launch my multishell. when i pasted everything into one file it works :huh:/> .
And now the question - why did second rawset didnt work when i used os.run() to launch my version of multishell?