1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:07:36 +00:00

SystemMonitor: Default initialize all thread state variables

Having bogus values here when we just initialize the thread state with a
process can lead to all sorts of bad things down the line, like infinite
draws.
This commit is contained in:
kleines Filmröllchen 2022-04-06 21:02:40 +02:00 committed by Andreas Kling
parent bafaff61c9
commit 8545e2dec0

View file

@ -94,41 +94,41 @@ private:
struct Process; struct Process;
struct ThreadState { struct ThreadState {
pid_t tid; pid_t tid { 0 };
pid_t pid; pid_t pid { 0 };
pid_t ppid; pid_t ppid { 0 };
pid_t pgid; pid_t pgid { 0 };
pid_t sid; pid_t sid { 0 };
u64 time_user; u64 time_user { 0 };
u64 time_kernel; u64 time_kernel { 0 };
bool kernel; bool kernel { false };
String executable; String executable { "" };
String name; String name { "" };
uid_t uid; uid_t uid { 0 };
String state; String state { "" };
String user; String user { "" };
String pledge; String pledge { "" };
String veil; String veil { "" };
u32 cpu; u32 cpu { 0 };
u32 priority; u32 priority { 0 };
size_t amount_virtual; size_t amount_virtual { 0 };
size_t amount_resident; size_t amount_resident { 0 };
size_t amount_dirty_private; size_t amount_dirty_private { 0 };
size_t amount_clean_inode; size_t amount_clean_inode { 0 };
size_t amount_purgeable_volatile; size_t amount_purgeable_volatile { 0 };
size_t amount_purgeable_nonvolatile; size_t amount_purgeable_nonvolatile { 0 };
unsigned syscall_count; unsigned syscall_count { 0 };
unsigned inode_faults; unsigned inode_faults { 0 };
unsigned zero_faults; unsigned zero_faults { 0 };
unsigned cow_faults; unsigned cow_faults { 0 };
unsigned unix_socket_read_bytes; unsigned unix_socket_read_bytes { 0 };
unsigned unix_socket_write_bytes; unsigned unix_socket_write_bytes { 0 };
unsigned ipv4_socket_read_bytes; unsigned ipv4_socket_read_bytes { 0 };
unsigned ipv4_socket_write_bytes; unsigned ipv4_socket_write_bytes { 0 };
unsigned file_read_bytes; unsigned file_read_bytes { 0 };
unsigned file_write_bytes; unsigned file_write_bytes { 0 };
float cpu_percent; float cpu_percent { 0 };
float cpu_percent_kernel; float cpu_percent_kernel { 0 };
Process& process; Process& process;
ThreadState(Process& argument_process) ThreadState(Process& argument_process)