diff options
author | Daniel Lange <DLange@git.local> | 2024-01-10 11:17:08 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2024-01-10 11:17:08 +0100 |
commit | e7372d18a1a661d8c3dba9f51e1f17b5f94171a7 (patch) | |
tree | e8270dd60ec096bee8157dbadf029e15ed584592 /TasksMeter.c | |
parent | 937052b231259a47d881d539ad5748245ef55b99 (diff) | |
download | debian_htop-e7372d18a1a661d8c3dba9f51e1f17b5f94171a7.tar.gz debian_htop-e7372d18a1a661d8c3dba9f51e1f17b5f94171a7.tar.bz2 debian_htop-e7372d18a1a661d8c3dba9f51e1f17b5f94171a7.zip |
New upstream version 3.3.0
Diffstat (limited to 'TasksMeter.c')
-rw-r--r-- | TasksMeter.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/TasksMeter.c b/TasksMeter.c index 64c9837..aa41e63 100644 --- a/TasksMeter.c +++ b/TasksMeter.c @@ -5,12 +5,15 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "TasksMeter.h" #include "CRT.h" +#include "Machine.h" #include "Macros.h" #include "Object.h" -#include "ProcessList.h" +#include "ProcessTable.h" #include "RichString.h" #include "Settings.h" #include "XUtils.h" @@ -24,19 +27,21 @@ static const int TasksMeter_attributes[] = { }; static void TasksMeter_updateValues(Meter* this) { - const ProcessList* pl = this->pl; - this->values[0] = pl->kernelThreads; - this->values[1] = pl->userlandThreads; - this->values[2] = pl->totalTasks - pl->kernelThreads - pl->userlandThreads; - this->values[3] = MINIMUM(pl->runningTasks, pl->activeCPUs); - this->total = pl->totalTasks; + const Machine* host = this->host; + const ProcessTable* pt = (const ProcessTable*) host->processTable; + + this->values[0] = pt->kernelThreads; + this->values[1] = pt->userlandThreads; + this->values[2] = pt->totalTasks - pt->kernelThreads - pt->userlandThreads; + this->values[3] = MINIMUM(pt->runningTasks, host->activeCPUs); + this->total = pt->totalTasks; - xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%u/%u", MINIMUM(pl->runningTasks, pl->activeCPUs), pl->totalTasks); + xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%u/%u", MINIMUM(pt->runningTasks, host->activeCPUs), pt->totalTasks); } static void TasksMeter_display(const Object* cast, RichString* out) { const Meter* this = (const Meter*)cast; - const Settings* settings = this->pl->settings; + const Settings* settings = this->host->settings; char buffer[20]; int len; |