Title: [169373] trunk/Source/WTF
Revision
169373
Author
commit-qu...@webkit.org
Date
2014-05-27 01:08:24 -0700 (Tue, 27 May 2014)

Log Message

[GLIB] RunLoop::dispatch always executes the function on the main thread instead of the target thread.
https://bugs.webkit.org/show_bug.cgi?id=133291

Patch by Gwang Yoon Hwang <y...@igalia.com> on 2014-05-27
Reviewed by Carlos Garcia Campos.

GMainLoopSource::schedule[AfterDelay] must be used with the appropriate
GMainContext. Because current implementations in RunLoopGtk passes nullptr
instead of its runLoopContext when using GMainLoopSource, all of dispatched
functions are executed on the main thread regardless of which runloops is used.

This patch fixes the issue by passing the m_runLoopContext instead the default
parameter to the GMainLoopSource::schedule[AfterDelay].

* wtf/gtk/RunLoopGtk.cpp:
(WTF::RunLoop::wakeUp):
(WTF::RunLoop::TimerBase::start):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (169372 => 169373)


--- trunk/Source/WTF/ChangeLog	2014-05-27 07:17:52 UTC (rev 169372)
+++ trunk/Source/WTF/ChangeLog	2014-05-27 08:08:24 UTC (rev 169373)
@@ -1,3 +1,22 @@
+2014-05-27  Gwang Yoon Hwang  <y...@igalia.com>
+
+        [GLIB] RunLoop::dispatch always executes the function on the main thread instead of the target thread.
+        https://bugs.webkit.org/show_bug.cgi?id=133291
+
+        Reviewed by Carlos Garcia Campos.
+
+        GMainLoopSource::schedule[AfterDelay] must be used with the appropriate
+        GMainContext. Because current implementations in RunLoopGtk passes nullptr
+        instead of its runLoopContext when using GMainLoopSource, all of dispatched
+        functions are executed on the main thread regardless of which runloops is used.
+
+        This patch fixes the issue by passing the m_runLoopContext instead the default
+        parameter to the GMainLoopSource::schedule[AfterDelay].
+
+        * wtf/gtk/RunLoopGtk.cpp:
+        (WTF::RunLoop::wakeUp):
+        (WTF::RunLoop::TimerBase::start):
+
 2014-05-26  Darin Adler  <da...@apple.com>
 
         Class name matching should use ASCII case-insensitive matching, not Unicode case folding

Modified: trunk/Source/WTF/wtf/gtk/RunLoopGtk.cpp (169372 => 169373)


--- trunk/Source/WTF/wtf/gtk/RunLoopGtk.cpp	2014-05-27 07:17:52 UTC (rev 169372)
+++ trunk/Source/WTF/wtf/gtk/RunLoopGtk.cpp	2014-05-27 08:08:24 UTC (rev 169373)
@@ -102,7 +102,7 @@
     RefPtr<RunLoop> runLoop(this);
     GMainLoopSource::createAndDeleteOnDestroy().schedule("[WebKit] RunLoop work", std::function<void()>([runLoop] {
         runLoop->performWork();
-    }));
+    }), G_PRIORITY_DEFAULT, nullptr, m_runLoopContext.get());
     g_main_context_wakeup(m_runLoopContext.get());
 }
 
@@ -119,7 +119,7 @@
 void RunLoop::TimerBase::start(double fireInterval, bool repeat)
 {
     m_timerSource.scheduleAfterDelay("[WebKit] RunLoop::Timer", std::function<bool ()>([this, repeat] { fired(); return repeat; }),
-        std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::duration<double>(fireInterval)));
+        std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::duration<double>(fireInterval)), G_PRIORITY_DEFAULT, nullptr, m_runLoop.m_runLoopContext.get());
 }
 
 void RunLoop::TimerBase::stop()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to