Title: [188951] releases/WebKitGTK/webkit-2.10/Source/WebCore
Revision
188951
Author
carlo...@webkit.org
Date
2015-08-26 00:44:24 -0700 (Wed, 26 Aug 2015)

Log Message

Merge r188931 - IconDatabase: syncThreadMainLoop() is unlocking m_syncLock twice when thread termination is requested
https://bugs.webkit.org/show_bug.cgi?id=148429

Patch by Carlos Garcia Campos <cgar...@igalia.com> on 2015-08-25
Reviewed by Filip Pizlo.

The lock is released an locked on every loop iteration, and then
unlocked again after the loop. There's an early break in the loop
when thread termination is requested that happens after the lock
is released but before is locked again, so that the unlock after
the loop is trying to unlock the lock again. This was not a
problem before, but the new Lock has an assertion to ensure that a
lock is not released twice.

* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::syncThreadMainLoop): Clean up the thread
and return instead of breaking the loop when thread termination is
requested.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (188950 => 188951)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2015-08-26 07:32:28 UTC (rev 188950)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2015-08-26 07:44:24 UTC (rev 188951)
@@ -1,3 +1,23 @@
+2015-08-25  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        IconDatabase: syncThreadMainLoop() is unlocking m_syncLock twice when thread termination is requested
+        https://bugs.webkit.org/show_bug.cgi?id=148429
+
+        Reviewed by Filip Pizlo.
+
+        The lock is released an locked on every loop iteration, and then
+        unlocked again after the loop. There's an early break in the loop
+        when thread termination is requested that happens after the lock
+        is released but before is locked again, so that the unlock after
+        the loop is trying to unlock the lock again. This was not a
+        problem before, but the new Lock has an assertion to ensure that a
+        lock is not released twice.
+
+        * loader/icon/IconDatabase.cpp:
+        (WebCore::IconDatabase::syncThreadMainLoop): Clean up the thread
+        and return instead of breaking the loop when thread termination is
+        requested.
+
 2015-08-18  Filip Pizlo  <fpi...@apple.com>
 
         Replace all uses of std::mutex/std::condition_variable with WTF::Lock/WTF::Condition

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/loader/icon/IconDatabase.cpp (188950 => 188951)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/loader/icon/IconDatabase.cpp	2015-08-26 07:32:28 UTC (rev 188950)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/loader/icon/IconDatabase.cpp	2015-08-26 07:44:24 UTC (rev 188951)
@@ -1367,8 +1367,10 @@
         }
         
         // Then, if the thread should be quitting, quit now!
-        if (m_threadTerminationRequested)
-            break;
+        if (m_threadTerminationRequested) {
+            cleanupSyncThread();
+            return;
+        }
 
         {
             LockHolder locker(m_urlAndIconLock);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to