Title: [240851] releases/WebKitGTK/webkit-2.22/Source/WebCore
- Revision
- 240851
- Author
- [email protected]
- Date
- 2019-02-01 09:00:02 -0800 (Fri, 01 Feb 2019)
Log Message
Merge r240841 - Race-condition during scrolling thread creation
https://bugs.webkit.org/show_bug.cgi?id=194016
Reviewed by Saam Barati.
There is a threading issue during the initialization
of the scrolling thread caused by createThreadIfNeeded
locking only on the creation of the thread but not on
the initialization of the main loop, making it possible
for a thread to try to spin the main loop before it's
created.
Fix this by unconditionally waiting on the main loop
being created. This makes it necessary to always hold
the lock, even when the thread is already created.
* page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::createThreadIfNeeded):
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog (240850 => 240851)
--- releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog 2019-02-01 16:51:14 UTC (rev 240850)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog 2019-02-01 17:00:02 UTC (rev 240851)
@@ -1,3 +1,24 @@
+2019-02-01 Claudio Saavedra <[email protected]>
+
+ Race-condition during scrolling thread creation
+ https://bugs.webkit.org/show_bug.cgi?id=194016
+
+ Reviewed by Saam Barati.
+
+ There is a threading issue during the initialization
+ of the scrolling thread caused by createThreadIfNeeded
+ locking only on the creation of the thread but not on
+ the initialization of the main loop, making it possible
+ for a thread to try to spin the main loop before it's
+ created.
+
+ Fix this by unconditionally waiting on the main loop
+ being created. This makes it necessary to always hold
+ the lock, even when the thread is already created.
+
+ * page/scrolling/ScrollingThread.cpp:
+ (WebCore::ScrollingThread::createThreadIfNeeded):
+
2019-01-31 Alexander Mikhaylenko <[email protected]>
[GTK] Momentum scrolling stops abruptly before websites end
Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/page/scrolling/ScrollingThread.cpp (240850 => 240851)
--- releases/WebKitGTK/webkit-2.22/Source/WebCore/page/scrolling/ScrollingThread.cpp 2019-02-01 16:51:14 UTC (rev 240850)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/page/scrolling/ScrollingThread.cpp 2019-02-01 17:00:02 UTC (rev 240851)
@@ -72,24 +72,21 @@
void ScrollingThread::createThreadIfNeeded()
{
- if (m_thread)
- return;
-
// Wait for the thread to initialize the run loop.
- {
- std::unique_lock<Lock> lock(m_initializeRunLoopMutex);
+ std::unique_lock<Lock> lock(m_initializeRunLoopMutex);
+ if (!m_thread) {
m_thread = Thread::create("WebCore: Scrolling", [this] {
WTF::Thread::setCurrentThreadIsUserInteractive();
initializeRunLoop();
});
-
+ }
+
#if PLATFORM(COCOA)
- m_initializeRunLoopConditionVariable.wait(lock, [this]{ return m_threadRunLoop; });
+ m_initializeRunLoopConditionVariable.wait(lock, [this]{ return m_threadRunLoop; });
#else
- m_initializeRunLoopConditionVariable.wait(lock, [this]{ return m_runLoop; });
+ m_initializeRunLoopConditionVariable.wait(lock, [this]{ return m_runLoop; });
#endif
- }
}
void ScrollingThread::dispatchFunctionsFromScrollingThread()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes