Changeset 91171 in webkit


Ignore:
Timestamp:
Jul 17, 2011 7:58:46 PM (13 years ago)
Author:
ryuan.choi@samsung.com
Message:

[EFL] Refactor scheduleDispatchFunctionsOnMainThread to fix crash.
https://bugs.webkit.org/show_bug.cgi?id=64337

Replace ecore_timer_add to Ecore_Pipe.
This is needed because ecore_timer should not be called in a child thread,
but in the main thread.

Reviewed by Antonio Gomes.

  • wtf/efl/MainThreadEfl.cpp:

(WTF::pipeObject):
(WTF::monitorDispatchFunctions):
(WTF::initializeMainThreadPlatform):
(WTF::scheduleDispatchFunctionsOnMainThread):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r91168 r91171  
     12011-07-17  Ryuan Choi  <ryuan.choi@samsung.com>
     2
     3        [EFL] Refactor scheduleDispatchFunctionsOnMainThread to fix crash.
     4        https://bugs.webkit.org/show_bug.cgi?id=64337
     5
     6        Replace ecore_timer_add to Ecore_Pipe.
     7        This is needed because ecore_timer should not be called in a child thread,
     8        but in the main thread.
     9
     10        Reviewed by Antonio Gomes.
     11
     12        * wtf/efl/MainThreadEfl.cpp:
     13        (WTF::pipeObject):
     14        (WTF::monitorDispatchFunctions):
     15        (WTF::initializeMainThreadPlatform):
     16        (WTF::scheduleDispatchFunctionsOnMainThread):
     17
    1182011-07-17  Filip Pizlo  <fpizlo@apple.com>
    219
  • trunk/Source/JavaScriptCore/wtf/efl/MainThreadEfl.cpp

    r62015 r91171  
    3636
    3737#include <Ecore.h>
     38#include <wtf/OwnPtr.h>
     39#include <wtf/PassOwnPtr.h>
     40#include <wtf/StdLibExtras.h>
    3841
    3942namespace WTF {
    4043
     44static OwnPtr<Ecore_Pipe>& pipeObject()
     45{
     46    DEFINE_STATIC_LOCAL(OwnPtr<Ecore_Pipe>, pipeObject, ());
     47    return pipeObject;
     48}
     49
     50static void monitorDispatchFunctions(void*, void*, unsigned int)
     51{
     52    dispatchFunctionsFromMainThread();
     53}
     54
    4155void initializeMainThreadPlatform()
    4256{
    43 }
    44 
    45 static Eina_Bool timeoutFired(void*)
    46 {
    47     dispatchFunctionsFromMainThread();
    48     return ECORE_CALLBACK_CANCEL;
     57    pipeObject() = adoptPtr(ecore_pipe_add(monitorDispatchFunctions, 0));
    4958}
    5059
    5160void scheduleDispatchFunctionsOnMainThread()
    5261{
    53     ecore_timer_add(0, timeoutFired, 0);
     62    ecore_pipe_write(pipeObject().get(), "", 0);
    5463}
    5564
    56 
    5765}
Note: See TracChangeset for help on using the changeset viewer.