[EFL] Use mutex locker in wakeUp() to ensure thread-safety.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Nov 2012 14:38:33 +0000 (14:38 +0000)
committerByungwoo Lee <bw80.lee@samsung.com>
Wed, 27 Mar 2013 03:53:26 +0000 (12:53 +0900)
https://bugs.webkit.org/show_bug.cgi?id=101132

Patch by Byungwoo Lee <bw80.lee@samsung.com> on 2012-11-28
Reviewed by Gyuyoung Kim.

Add mutex locker for the ecore pipe to ensure thread-safety of
RunLoop::wakeUp().

RunLoop::wakeUp() can be called by multiple thread. It uses
ecore_pipe_write() function but the function is not thread-safe.

* platform/RunLoop.h:
(RunLoop):
* platform/efl/RunLoopEfl.cpp:
(WebCore::RunLoop::wakeUp):

Change-Id: I36bae620af903781cdb3470888aabc434dbdb7b9
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136006 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/RunLoop.h
Source/WebCore/platform/efl/RunLoopEfl.cpp

index c59f731..c8e7ad5 100644 (file)
@@ -1,12 +1,3 @@
-2012-11-30  Jer Noble  <jer.noble@apple.com>
-
-        Unreviewed Windows build fix.
-
-        Add a default: entry to an case statement to fix a build error when compiled in VS2005.
-
-        * html/MediaController.cpp:
-        (MediaController::playbackState):
-
 2012-12-11  Viatcheslav Ostapenko  <sl.ostapenko@samsung.com>
 
         Remove conversion to/from float and float division from ImageFrame::setRGBA
         (WebCore::ImageFrame::fixPointUnsignedMultiply):
         (WebCore::ImageFrame::setRGBA):
 
+2012-11-30  Jer Noble  <jer.noble@apple.com>
+
+        Unreviewed Windows build fix.
+
+        Add a default: entry to an case statement to fix a build error when compiled in VS2005.
+
+        * html/MediaController.cpp:
+        (MediaController::playbackState):
+
+2012-11-28  Byungwoo Lee  <bw80.lee@samsung.com>
+
+        [EFL] Use mutex locker in wakeUp() to ensure thread-safety.
+        https://bugs.webkit.org/show_bug.cgi?id=101132
+
+        Reviewed by Gyuyoung Kim.
+
+        Add mutex locker for the ecore pipe to ensure thread-safety of
+        RunLoop::wakeUp().
+
+        RunLoop::wakeUp() can be called by multiple thread. It uses
+        ecore_pipe_write() function but the function is not thread-safe.
+
+        * platform/RunLoop.h:
+        (RunLoop):
+        * platform/efl/RunLoopEfl.cpp:
+        (WebCore::RunLoop::wakeUp):
+
 2012-11-09  Huang Dongsung  <luxtella@company100.net>
 
         Coordinated Graphics: Remove a backing store of GraphicsLayer when the layer is far from the viewport.
index 90d0ad7..fbfb837 100644 (file)
@@ -137,8 +137,6 @@ private:
     Mutex m_functionQueueLock;
     Deque<Function<void()> > m_functionQueue;
 
-    Mutex m_wakeUpLock;
-
 #if PLATFORM(WIN)
     static bool registerRunLoopMessageWindowClass();
     static LRESULT CALLBACK RunLoopWndProc(HWND, UINT, WPARAM, LPARAM);
@@ -169,7 +167,10 @@ private:
     Vector<GRefPtr<GMainLoop> > m_runLoopMainLoops;
 #elif PLATFORM(EFL)
     bool m_initEfl;
+
+    Mutex m_pipeLock;
     OwnPtr<Ecore_Pipe> m_pipe;
+
     static void wakeUpEvent(void* data, void*, unsigned int);
 #endif
 };
index d7df114..8fd97dc 100644 (file)
@@ -104,7 +104,7 @@ void RunLoop::wakeUpEvent(void* data, void*, unsigned int)
 
 void RunLoop::wakeUp()
 {
-    MutexLocker locker(m_wakeUpLock);
+    MutexLocker locker(m_pipeLock);
 #if ENABLE(TIZEN_RUNLOOP_WAKEUP_ERROR_WORKAROUND)
     Eina_Bool result = false;
     while(1) {