From e7372d18a1a661d8c3dba9f51e1f17b5f94171a7 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Wed, 10 Jan 2024 11:17:08 +0100 Subject: New upstream version 3.3.0 --- TasksMeter.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'TasksMeter.c') 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; -- cgit v1.2.3