Title: [188931] trunk/Source/WebCore
Revision
188931
Author
commit-qu...@webkit.org
Date
2015-08-25 12:16:08 -0700 (Tue, 25 Aug 2015)

Log Message

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: trunk/Source/WebCore/ChangeLog (188930 => 188931)


--- trunk/Source/WebCore/ChangeLog	2015-08-25 19:14:55 UTC (rev 188930)
+++ trunk/Source/WebCore/ChangeLog	2015-08-25 19:16:08 UTC (rev 188931)
@@ -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-25  Nan Wang  <n_w...@apple.com>
 
         [Mac] accessibility/document-attributes.html fails

Modified: trunk/Source/WebCore/loader/icon/IconDatabase.cpp (188930 => 188931)


--- trunk/Source/WebCore/loader/icon/IconDatabase.cpp	2015-08-25 19:14:55 UTC (rev 188930)
+++ trunk/Source/WebCore/loader/icon/IconDatabase.cpp	2015-08-25 19:16:08 UTC (rev 188931)
@@ -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