Fix ghost threads in CPU

* kernel: Make sf9 return TSTATE_FREE for invalid slots: 0, >255, free.
* menu: Ignore free slots even if other fields of proc_info look valid.
        Documentation (sysfuncs.txt) clearly states all the other info
        as invalid when slot_state is TSTATE_FREE.
* taskbar: Same as menu.
* cmm/lib/*: Same as menu.
* programs/macros.inc: Add TSTATE_* macros.
This commit is contained in:
2025-02-01 02:53:14 +00:00
parent 6933ee64cd
commit d235c8914c
6 changed files with 39 additions and 28 deletions

View File

@@ -450,6 +450,15 @@ struct BOX
height dd ?
ends
; Thread states:
TSTATE_RUNNING = 0
TSTATE_RUN_SUSPENDED = 1
TSTATE_WAIT_SUSPENDED = 2
TSTATE_ZOMBIE = 3
TSTATE_TERMINATING = 4
TSTATE_WAITING = 5
TSTATE_FREE = 9
; structures used in KolibriOS
struct process_information
cpu_usage dd ? ; +0
@@ -461,7 +470,7 @@ struct process_information
used_memory dd ? ; +26
PID dd ? ; +30
box BOX ; +34
slot_state dw ? ; +50
slot_state dw ? ; +50 TSTATE_*
dw ? ; +52
client_box BOX ; +54
wnd_state db ? ; +70