From be17d6ee1028a5b3d54d267c35f34bf0cf54527f Mon Sep 17 00:00:00 2001 From: Alastair Poole Date: Fri, 26 Jun 2020 21:57:38 +0100 Subject: [PATCH] cpu: LoC --- src/bin/ui/ui_cpu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bin/ui/ui_cpu.c b/src/bin/ui/ui_cpu.c index 433d6d4..0e4af97 100644 --- a/src/bin/ui/ui_cpu.c +++ b/src/bin/ui/ui_cpu.c @@ -157,19 +157,20 @@ _core_times_cb(void *data, Ecore_Thread *thread) cpu_core_t **cores; Eina_List *l; Ui *ui; - int ncpu, i; + int ncpu; ui = data; - while (!ecore_thread_check(thread)) + for (int i = 0; !ecore_thread_check(thread); i = 0) { if (!ui->cpu_visible) { usleep(1000000); continue; } - i = 0; + cores = system_cpu_usage_get(&ncpu); + EINA_LIST_FOREACH(ui->cpu_list, l, progress) { *progress->value = cores[i]->percent;