summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-10-10 11:29:07 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-10-10 17:56:58 +0200
commitd57067989afdb72e43bc1a95be9e02869d8dfb2a (patch)
treee0c37baa5d3c4864e3e4dfce1c8dce62a2001ff4
parentca863efeac8bcf9a01f96651e7fbc7fdb9ab1377 (diff)
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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index e898b6e..cdd5120 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)
528} 528}
529 529
530static void 530static void
531_ecore_main_idler_all_call(Eo *loop) 531_ecore_main_idler_all_call(Eo *loop, Efl_Loop_Data *pd)
532{ 532{
533 efl_event_callback_call(loop, EFL_LOOP_EVENT_IDLE, NULL); 533 if (pd->idlers)
534 efl_event_callback_call(loop, EFL_LOOP_EVENT_IDLE, NULL);
534 // just spin in an idler until the free queue is empty freeing 84 items 535 // just spin in an idler until the free queue is empty freeing 84 items
535 // from the free queue each time.for now this seems like an ok balance 536 // from the free queue each time.for now this seems like an ok balance
536 // between going in and out of a reduce func with mutexes around it 537 // 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,
803 804
804 if (ecore_idling) 805 if (ecore_idling)
805 { 806 {
806 _ecore_main_idler_all_call(obj); 807 _ecore_main_idler_all_call(obj, pd);
807 808
808 events_ready = pd->message_queue ? 1 : 0; 809 events_ready = pd->message_queue ? 1 : 0;
809 810
@@ -2236,7 +2237,7 @@ _ecore_main_loop_uv_prepare(uv_prepare_t *handle EINA_UNUSED)
2236 2237
2237 if (_ecore_main_uv_idling) 2238 if (_ecore_main_uv_idling)
2238 { 2239 {
2239 _ecore_main_idler_all_call(obj); 2240 _ecore_main_idler_all_call(obj, pd);
2240 DBG("called idles"); 2241 DBG("called idles");
2241 if (_ecore_main_idlers_exist(pd) || (pd->message_queue)) t = 0.0; 2242 if (_ecore_main_idlers_exist(pd) || (pd->message_queue)) t = 0.0;
2242 } 2243 }
@@ -2300,7 +2301,7 @@ _ecore_main_loop_spin_core(Eo *obj, Efl_Loop_Data *pd)
2300 // as we are spinning we need to update loop time per spin 2301 // as we are spinning we need to update loop time per spin
2301 _update_loop_time(pd); 2302 _update_loop_time(pd);
2302 // call all idlers 2303 // call all idlers
2303 _ecore_main_idler_all_call(obj); 2304 _ecore_main_idler_all_call(obj, pd);
2304 // which returns false if no more idelrs exist 2305 // which returns false if no more idelrs exist
2305 if (!_ecore_main_idlers_exist(pd)) return SPIN_RESTART; 2306 if (!_ecore_main_idlers_exist(pd)) return SPIN_RESTART;
2306 // sneaky - drop through or if checks - the first one to succeed 2307 // sneaky - drop through or if checks - the first one to succeed