Sysinfo gadgets: Revert all uses of faulty e_powersave_sleeper.

This commit is contained in:
Stephen 'Okra' Houston 2017-09-11 13:24:54 -05:00
parent 81fc3d6837
commit f8e17b67e4
7 changed files with 11 additions and 26 deletions

View File

@ -16,7 +16,6 @@ struct _Thread_Config
{ {
int interval; int interval;
Instance *inst; Instance *inst;
E_Powersave_Sleeper *sleeper;
}; };
typedef struct _Pstate_Config Pstate_Config; typedef struct _Pstate_Config Pstate_Config;
@ -840,7 +839,7 @@ _cpuclock_cb_frequency_check_main(void *data, Ecore_Thread *th)
else else
_cpuclock_status_free(status); _cpuclock_status_free(status);
if (ecore_thread_check(th)) break; if (ecore_thread_check(th)) break;
e_powersave_sleeper_sleep(thc->sleeper, thc->interval); usleep((1000000.0 / 8.0) * (double)thc->interval);
if (ecore_thread_check(th)) break; if (ecore_thread_check(th)) break;
} }
} }
@ -894,7 +893,6 @@ _cpuclock_cb_frequency_check_end(void *data, Ecore_Thread *th EINA_UNUSED)
{ {
Thread_Config *thc = data; Thread_Config *thc = data;
e_powersave_sleeper_free(thc->sleeper);
E_FREE(thc); E_FREE(thc);
} }
@ -912,7 +910,6 @@ _cpuclock_poll_interval_update(Instance *inst)
if (thc) if (thc)
{ {
thc->inst = inst; thc->inst = inst;
thc->sleeper = e_powersave_sleeper_new();
thc->interval = inst->cfg->cpuclock.poll_interval; thc->interval = inst->cfg->cpuclock.poll_interval;
inst->cfg->cpuclock.frequency_check_thread = inst->cfg->cpuclock.frequency_check_thread =
ecore_thread_feedback_run(_cpuclock_cb_frequency_check_main, ecore_thread_feedback_run(_cpuclock_cb_frequency_check_main,

View File

@ -10,7 +10,6 @@ struct _Thread_Config
unsigned long total; unsigned long total;
unsigned long idle; unsigned long idle;
Instance *inst; Instance *inst;
E_Powersave_Sleeper *sleeper;
Eina_List *cores; Eina_List *cores;
}; };
@ -173,7 +172,7 @@ _cpumonitor_cb_usage_check_main(void *data, Ecore_Thread *th)
#endif #endif
ecore_thread_feedback(th, NULL); ecore_thread_feedback(th, NULL);
if (ecore_thread_check(th)) break; if (ecore_thread_check(th)) break;
e_powersave_sleeper_sleep(thc->sleeper, thc->interval); usleep((1000000.0 / 8.0) * (double)thc->interval);
if (ecore_thread_check(th)) break; if (ecore_thread_check(th)) break;
} }
} }
@ -197,7 +196,6 @@ _cpumonitor_cb_usage_check_end(void *data, Ecore_Thread *th EINA_UNUSED)
Thread_Config *thc = data; Thread_Config *thc = data;
CPU_Core *core; CPU_Core *core;
e_powersave_sleeper_free(thc->sleeper);
EINA_LIST_FREE(thc->cores, core) EINA_LIST_FREE(thc->cores, core)
E_FREE(core); E_FREE(core);
E_FREE(thc); E_FREE(thc);
@ -307,7 +305,6 @@ _cpumonitor_config_updated(Instance *inst)
thc->idle = 0; thc->idle = 0;
thc->percent = 0; thc->percent = 0;
thc->interval = inst->cfg->cpumonitor.poll_interval; thc->interval = inst->cfg->cpumonitor.poll_interval;
thc->sleeper = e_powersave_sleeper_new();
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
thc->num_cores = _cpumonitor_sysctl_getcores(); thc->num_cores = _cpumonitor_sysctl_getcores();
#else #else

View File

@ -15,7 +15,6 @@ struct _Thread_Config
unsigned long mem_shared; unsigned long mem_shared;
unsigned long swp_total; unsigned long swp_total;
unsigned long swp_used; unsigned long swp_used;
E_Powersave_Sleeper *sleeper;
}; };
static void static void
@ -294,7 +293,7 @@ _memusage_cb_usage_check_main(void *data, Ecore_Thread *th)
ecore_thread_feedback(th, NULL); ecore_thread_feedback(th, NULL);
if (ecore_thread_check(th)) break; if (ecore_thread_check(th)) break;
e_powersave_sleeper_sleep(thc->sleeper, thc->interval); usleep((1000000.0 / 8.0) * (double)thc->interval);
if (ecore_thread_check(th)) break; if (ecore_thread_check(th)) break;
} }
} }
@ -303,7 +302,6 @@ static void
_memusage_cb_usage_check_end(void *data, Ecore_Thread *th EINA_UNUSED) _memusage_cb_usage_check_end(void *data, Ecore_Thread *th EINA_UNUSED)
{ {
Thread_Config *thc = data; Thread_Config *thc = data;
e_powersave_sleeper_free(thc->sleeper);
E_FREE(thc); E_FREE(thc);
} }
@ -374,7 +372,6 @@ _memusage_config_updated(Instance *inst)
if (thc) if (thc)
{ {
thc->inst = inst; thc->inst = inst;
thc->sleeper = e_powersave_sleeper_new();
thc->interval = inst->cfg->memusage.poll_interval; thc->interval = inst->cfg->memusage.poll_interval;
thc->mem_percent = 0; thc->mem_percent = 0;
thc->swp_percent = 0; thc->swp_percent = 0;

View File

@ -19,7 +19,6 @@ struct _Thread_Config
unsigned long outcurrent; unsigned long outcurrent;
unsigned long outmax; unsigned long outmax;
Eina_Stringshare *outstring; Eina_Stringshare *outstring;
E_Powersave_Sleeper *sleeper;
}; };
static void static void
@ -181,7 +180,7 @@ _netstatus_cb_usage_check_main(void *data, Ecore_Thread *th)
eina_stringshare_replace(&thc->outstring, rout); eina_stringshare_replace(&thc->outstring, rout);
ecore_thread_feedback(th, NULL); ecore_thread_feedback(th, NULL);
if (ecore_thread_check(th)) break; if (ecore_thread_check(th)) break;
e_powersave_sleeper_sleep(thc->sleeper, thc->interval); usleep((1000000.0 / 8.0) * (double)thc->interval);
if (ecore_thread_check(th)) break; if (ecore_thread_check(th)) break;
} }
} }
@ -205,7 +204,6 @@ static void
_netstatus_cb_usage_check_end(void *data, Ecore_Thread *th EINA_UNUSED) _netstatus_cb_usage_check_end(void *data, Ecore_Thread *th EINA_UNUSED)
{ {
Thread_Config *thc = data; Thread_Config *thc = data;
e_powersave_sleeper_free(thc->sleeper);
E_FREE_FUNC(thc->instring, eina_stringshare_del); E_FREE_FUNC(thc->instring, eina_stringshare_del);
E_FREE_FUNC(thc->outstring, eina_stringshare_del); E_FREE_FUNC(thc->outstring, eina_stringshare_del);
E_FREE(thc); E_FREE(thc);
@ -261,7 +259,6 @@ _netstatus_config_updated(Instance *inst)
if (thc) if (thc)
{ {
thc->inst = inst; thc->inst = inst;
thc->sleeper = e_powersave_sleeper_new();
thc->interval = inst->cfg->netstatus.poll_interval; thc->interval = inst->cfg->netstatus.poll_interval;
thc->in = 0; thc->in = 0;
thc->inmax = inst->cfg->netstatus.inmax; thc->inmax = inst->cfg->netstatus.inmax;

View File

@ -18,7 +18,7 @@ _netstatus_proc_getrstatus(Eina_Bool automax,
if (!*last_checked) if (!*last_checked)
*last_checked = current; *last_checked = current;
else if ((current - *last_checked) < 1) if ((current - *last_checked) < 1)
return; return;
else else
diff = current - *last_checked; diff = current - *last_checked;
@ -73,15 +73,15 @@ _netstatus_proc_gettstatus(Eina_Bool automax,
int percent = 0; int percent = 0;
char buf[4096], dummys[64]; char buf[4096], dummys[64];
FILE *f; FILE *f;
time_t current = time(NULL); time_t last = *last_checked, current = time(NULL);
time_t diff = 0; time_t diff = 0;
if (!*last_checked) if (!last)
*last_checked = current; *last_checked = current;
else if ((current - *last_checked) < 1) else if ((current - last) < 1)
return; return;
else else
diff = current - *last_checked; diff = current - last;
f = fopen("/proc/net/dev", "r"); f = fopen("/proc/net/dev", "r");
if (f) if (f)
{ {

View File

@ -76,7 +76,6 @@ struct _Tempthread
const char *sensor_name; const char *sensor_name;
const char *sensor_path; const char *sensor_path;
void *extn; void *extn;
E_Powersave_Sleeper *sleeper;
#if defined(HAVE_EEZE) #if defined(HAVE_EEZE)
Eina_List *tempdevs; Eina_List *tempdevs;
#endif #endif

View File

@ -14,7 +14,6 @@ _thermal_thread_free(Tempthread *tth)
EINA_LIST_FREE(tth->tempdevs, s) EINA_LIST_FREE(tth->tempdevs, s)
eina_stringshare_del(s); eina_stringshare_del(s);
#endif #endif
e_powersave_sleeper_free(tth->sleeper);
E_FREE(tth->extn); E_FREE(tth->extn);
E_FREE(tth); E_FREE(tth);
} }
@ -99,7 +98,7 @@ _thermal_check_sysctl(void *data, Ecore_Thread *th)
temp = thermal_sysctl_get(tth); temp = thermal_sysctl_get(tth);
if (ptemp != temp) ecore_thread_feedback(th, (void *)((long)temp)); if (ptemp != temp) ecore_thread_feedback(th, (void *)((long)temp));
ptemp = temp; ptemp = temp;
e_powersave_sleeper_sleep(tth->sleeper, tth->poll_interval); usleep((1000000.0 / 8.0) * (double)thc->poll_interval);
if (ecore_thread_check(th)) break; if (ecore_thread_check(th)) break;
} }
} }
@ -118,7 +117,7 @@ _thermal_check_fallback(void *data, Ecore_Thread *th)
temp = thermal_fallback_get(tth); temp = thermal_fallback_get(tth);
if (ptemp != temp) ecore_thread_feedback(th, (void *)((long)temp)); if (ptemp != temp) ecore_thread_feedback(th, (void *)((long)temp));
ptemp = temp; ptemp = temp;
e_powersave_sleeper_sleep(tth->sleeper, tth->poll_interval); usleep((1000000.0 / 8.0) * (double)thc->poll_interval);
if (ecore_thread_check(th)) break; if (ecore_thread_check(th)) break;
} }
} }
@ -274,7 +273,6 @@ _thermal_config_updated(Instance *inst)
tth->poll_interval = inst->cfg->thermal.poll_interval; tth->poll_interval = inst->cfg->thermal.poll_interval;
tth->sensor_type = inst->cfg->thermal.sensor_type; tth->sensor_type = inst->cfg->thermal.sensor_type;
tth->inst = inst; tth->inst = inst;
tth->sleeper = e_powersave_sleeper_new();
if (inst->cfg->thermal.sensor_name) if (inst->cfg->thermal.sensor_name)
tth->sensor_name = eina_stringshare_add(inst->cfg->thermal.sensor_name); tth->sensor_name = eina_stringshare_add(inst->cfg->thermal.sensor_name);