WebKit Bugzilla
Attachment 360572 Details for
Bug 194016
: Race-condition during scrolling thread creation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194016-20190130153028.patch (text/plain), 2.48 KB, created by
Claudio Saavedra
on 2019-01-30 05:30:29 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Claudio Saavedra
Created:
2019-01-30 05:30:29 PST
Size:
2.48 KB
patch
obsolete
>Subversion Revision: 240707 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 120c31f46a3df27188261e5363cdaad3648ac205..e19a71d8a34903639aa93b75f94d70ac362f436a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2019-01-30 Claudio Saavedra <csaavedra@igalia.com> >+ >+ Race-condition during scrolling thread creation >+ https://bugs.webkit.org/show_bug.cgi?id=194016 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-29 Rob Buis <rbuis@igalia.com> > > Align with Fetch on data: URLs >diff --git a/Source/WebCore/page/scrolling/ScrollingThread.cpp b/Source/WebCore/page/scrolling/ScrollingThread.cpp >index bd3ef00777cdcc1a93325afffeb7800d2df4a5b9..246666d2999cca8eadf53662b32e797e155b709c 100644 >--- a/Source/WebCore/page/scrolling/ScrollingThread.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingThread.cpp >@@ -72,24 +72,21 @@ ScrollingThread& ScrollingThread::singleton() > > 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()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194016
: 360572