summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorHosang Kim <hosang12.kim@samsung.com>2018-08-02 09:14:15 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-08-02 09:14:15 -0400
commita92274f81184cd06b398a0930110f2a4bee49e76 (patch)
tree3c56cc868338410adb8864d83431220f933e8250 /src/lib/ecore
parent9666f288ae606f181f676ad1768864d830d29ee3 (diff)
ecore: fix that timers are not called in the order they were registered.
Summary: Timers are not called in the order they were registered. Because when current timer is deleted, getting next timer is called twice. Test Plan: <error> Timer1 expired after 0.001 seconds. Timer3 expired after 0.001 seconds. Timer5 expired after 0.001 seconds. Timer7 expired after 0.001 seconds. Timer2 expired after 0.001 seconds. Timer6 expired after 0.001 seconds. Timer4 expired after 0.001 seconds. Timer8 expired after 0.001 seconds. <correct> Timer1 expired after 0.001 seconds. Timer2 expired after 0.001 seconds. Timer3 expired after 0.001 seconds. Timer4 expired after 0.001 seconds. Timer5 expired after 0.001 seconds. Timer6 expired after 0.001 seconds. Timer7 expired after 0.001 seconds. Timer8 expired after 0.001 seconds.| {F3268233} Reviewers: Hermet, Jaehyun_Cho, zmike, SanghyeonLee Reviewed By: zmike Subscribers: cedric, #committers, zmike Tags: #efl_tests Differential Revision: https://phab.enlightenment.org/D6700
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/ecore_timer.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/ecore/ecore_timer.c b/src/lib/ecore/ecore_timer.c
index 1ebce1f3df..776848875c 100644
--- a/src/lib/ecore/ecore_timer.c
+++ b/src/lib/ecore/ecore_timer.c
@@ -461,11 +461,20 @@ _efl_loop_timer_util_delay(Efl_Loop_Timer_Data *timer, double add)
461EOLIAN static void 461EOLIAN static void
462_efl_loop_timer_efl_object_parent_set(Eo *obj, Efl_Loop_Timer_Data *pd, Efl_Object *parent) 462_efl_loop_timer_efl_object_parent_set(Eo *obj, Efl_Loop_Timer_Data *pd, Efl_Object *parent)
463{ 463{
464 Eina_Inlist *first;
465
464 efl_parent_set(efl_super(obj, EFL_LOOP_TIMER_CLASS), parent); 466 efl_parent_set(efl_super(obj, EFL_LOOP_TIMER_CLASS), parent);
465 467
466 if ((!pd->constructed) || (!pd->finalized)) return; 468 if ((!pd->constructed) || (!pd->finalized)) return;
467 469
468 _efl_loop_timer_util_loop_clear(pd); 470 // Remove the timer from all possible pending list
471 first = eina_inlist_first(EINA_INLIST_GET(pd));
472 if (first == pd->loop_data->timers)
473 pd->loop_data->timers = eina_inlist_remove
474 (pd->loop_data->timers, EINA_INLIST_GET(pd));
475 else if (first == pd->loop_data->suspended)
476 pd->loop_data->suspended = eina_inlist_remove
477 (pd->loop_data->suspended, EINA_INLIST_GET(pd));
469 478
470 if (efl_invalidated_get(obj)) return; 479 if (efl_invalidated_get(obj)) return;
471 480
@@ -555,7 +564,7 @@ _efl_loop_timer_next_get(Eo *obj, Efl_Loop_Data *pd)
555static inline void 564static inline void
556_efl_loop_timer_reschedule(Efl_Loop_Timer_Data *timer, double when) 565_efl_loop_timer_reschedule(Efl_Loop_Timer_Data *timer, double when)
557{ 566{
558 if (timer->frozen) return; 567 if (timer->frozen || efl_invalidated_get(timer->object)) return;
559 568
560 if (timer->loop_data && 569 if (timer->loop_data &&
561 (EINA_INLIST_GET(timer)->next || EINA_INLIST_GET(timer)->prev)) 570 (EINA_INLIST_GET(timer)->next || EINA_INLIST_GET(timer)->prev))