diff options
author | kleines Filmröllchen <filmroellchen@serenityos.org> | 2022-04-06 21:02:40 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-04-06 22:41:54 +0200 |
commit | 8545e2dec0b7760ee0b49023d5e94881a6364126 (patch) | |
tree | 9b50152e863c6daa9dd7a651acc797c4ae9525f8 | |
parent | bafaff61c9b7b870cacbf61f6fb1a1f26e5d27b7 (diff) | |
download | serenity-8545e2dec0b7760ee0b49023d5e94881a6364126.zip |
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.
-rw-r--r-- | Userland/Applications/SystemMonitor/ProcessModel.h | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/Userland/Applications/SystemMonitor/ProcessModel.h b/Userland/Applications/SystemMonitor/ProcessModel.h index d8daecbeef..e87d032b93 100644 --- a/Userland/Applications/SystemMonitor/ProcessModel.h +++ b/Userland/Applications/SystemMonitor/ProcessModel.h @@ -94,41 +94,41 @@ private: struct Process; struct ThreadState { - pid_t tid; - pid_t pid; - pid_t ppid; - pid_t pgid; - pid_t sid; - u64 time_user; - u64 time_kernel; - bool kernel; - String executable; - String name; - uid_t uid; - String state; - String user; - String pledge; - String veil; - u32 cpu; - u32 priority; - size_t amount_virtual; - size_t amount_resident; - size_t amount_dirty_private; - size_t amount_clean_inode; - size_t amount_purgeable_volatile; - size_t amount_purgeable_nonvolatile; - unsigned syscall_count; - unsigned inode_faults; - unsigned zero_faults; - unsigned cow_faults; - unsigned unix_socket_read_bytes; - unsigned unix_socket_write_bytes; - unsigned ipv4_socket_read_bytes; - unsigned ipv4_socket_write_bytes; - unsigned file_read_bytes; - unsigned file_write_bytes; - float cpu_percent; - float cpu_percent_kernel; + pid_t tid { 0 }; + pid_t pid { 0 }; + pid_t ppid { 0 }; + pid_t pgid { 0 }; + pid_t sid { 0 }; + u64 time_user { 0 }; + u64 time_kernel { 0 }; + bool kernel { false }; + String executable { "" }; + String name { "" }; + uid_t uid { 0 }; + String state { "" }; + String user { "" }; + String pledge { "" }; + String veil { "" }; + u32 cpu { 0 }; + u32 priority { 0 }; + size_t amount_virtual { 0 }; + size_t amount_resident { 0 }; + size_t amount_dirty_private { 0 }; + size_t amount_clean_inode { 0 }; + size_t amount_purgeable_volatile { 0 }; + size_t amount_purgeable_nonvolatile { 0 }; + unsigned syscall_count { 0 }; + unsigned inode_faults { 0 }; + unsigned zero_faults { 0 }; + unsigned cow_faults { 0 }; + unsigned unix_socket_read_bytes { 0 }; + unsigned unix_socket_write_bytes { 0 }; + unsigned ipv4_socket_read_bytes { 0 }; + unsigned ipv4_socket_write_bytes { 0 }; + unsigned file_read_bytes { 0 }; + unsigned file_write_bytes { 0 }; + float cpu_percent { 0 }; + float cpu_percent_kernel { 0 }; Process& process; ThreadState(Process& argument_process) |