aboutsummaryrefslogtreecommitdiffstats
path: root/TasksMeter.c
diff options
context:
space:
mode:
Diffstat (limited to 'TasksMeter.c')
-rw-r--r--TasksMeter.c23
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;

© 2014-2024 Faster IT GmbH | imprint | privacy policy