diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2019-10-10 11:29:07 -0400 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-10-10 17:56:58 +0200 |
commit | d57067989afdb72e43bc1a95be9e02869d8dfb2a (patch) | |
tree | e0c37baa5d3c4864e3e4dfce1c8dce62a2001ff4 | |
parent | ca863efeac8bcf9a01f96651e7fbc7fdb9ab1377 (diff) | |
download | efl-devs/bu5hm4n/performances.tar.gz |
ecore: inhibit "idle" event emission if no subscribers existdevs/bu5hm4n/performances
it seems like this was intended to be handled already, but somehow it wasn't...
ref T8321
Differential Revision: https://phab.enlightenment.org/D10359
-rw-r--r-- | src/lib/ecore/ecore_main.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index e898b6e0f3..cdd51209a0 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -528,9 +528,10 @@ _ecore_main_idlers_exist(Efl_Loop_Data *pd) } static void -_ecore_main_idler_all_call(Eo *loop) +_ecore_main_idler_all_call(Eo *loop, Efl_Loop_Data *pd) { - efl_event_callback_call(loop, EFL_LOOP_EVENT_IDLE, NULL); + if (pd->idlers) + efl_event_callback_call(loop, EFL_LOOP_EVENT_IDLE, NULL); // just spin in an idler until the free queue is empty freeing 84 items // from the free queue each time.for now this seems like an ok balance // between going in and out of a reduce func with mutexes around it @@ -803,7 +804,7 @@ _ecore_main_gsource_dispatch(GSource *source EINA_UNUSED, if (ecore_idling) { - _ecore_main_idler_all_call(obj); + _ecore_main_idler_all_call(obj, pd); events_ready = pd->message_queue ? 1 : 0; @@ -2236,7 +2237,7 @@ _ecore_main_loop_uv_prepare(uv_prepare_t *handle EINA_UNUSED) if (_ecore_main_uv_idling) { - _ecore_main_idler_all_call(obj); + _ecore_main_idler_all_call(obj, pd); DBG("called idles"); if (_ecore_main_idlers_exist(pd) || (pd->message_queue)) t = 0.0; } @@ -2300,7 +2301,7 @@ _ecore_main_loop_spin_core(Eo *obj, Efl_Loop_Data *pd) // as we are spinning we need to update loop time per spin _update_loop_time(pd); // call all idlers - _ecore_main_idler_all_call(obj); + _ecore_main_idler_all_call(obj, pd); // which returns false if no more idelrs exist if (!_ecore_main_idlers_exist(pd)) return SPIN_RESTART; // sneaky - drop through or if checks - the first one to succeed |