[Webkit-unassigned] [Bug 62380] [EFL] correct sharedTimer value in SharedTimerEfl.cpp

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 10 06:11:59 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=62380





--- Comment #16 from Lucas De Marchi <demarchi at webkit.org>  2011-06-10 06:11:59 PST ---
(From update of attachment 96682)
View in context: https://bugs.webkit.org/attachment.cgi?id=96682&action=review

> Source/WebCore/ChangeLog:12
> +        SharedTimerEfl.cpp set _sharedTimer = 0 is incorrect in 
> +        timerEvent(), we have observed addNewTimer() can be triggered 
> +        by either inside timerFunction() or others that are not within
> +        timerFunction().  We have observed the following case:
> +        1. add a new Timer within timerFunction()

You are right. If we can setup a new timer from within the callback, this will indeed be bogus.

However your patch creates another bug:

 1. addNewTimer() is called by WebCore;
 2 timerEvent() is triggered by Ecore. With your patch _sharedTimer is not set to 0;
 3. addNewTimer() is called by WebCore;
   -> stopSharedTimer() is called. Since _sharedTimer is not 0, it deletes a non-existent timer


The solution for this problem is setting _sharedTimer to 0 before calling timerFunction, like below:


diff --git a/Source/WebCore/platform/efl/SharedTimerEfl.cpp b/Source/WebCore/platform/efl/SharedTimerEfl.cpp
index 2534c60..a8a6ac6 100644
--- a/Source/WebCore/platform/efl/SharedTimerEfl.cpp
+++ b/Source/WebCore/platform/efl/SharedTimerEfl.cpp
@@ -47,11 +47,11 @@ void setSharedTimerFiredFunction(void (*func)())

 static Eina_Bool timerEvent(void*)
 {
+    _sharedTimer = 0;
+
     if (_timerFunction)
         _timerFunction();

-    _sharedTimer = 0;
-
     return ECORE_CALLBACK_CANCEL;
 }



Is that ok? I think this covers all the use-cases.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list