Title: [117625] trunk/Source/WebCore
Revision
117625
Author
[email protected]
Date
2012-05-18 14:10:29 -0700 (Fri, 18 May 2012)

Log Message

[Qt] REGRESSION(r117501): It made almost all tests assert in debug mode
https://bugs.webkit.org/show_bug.cgi?id=86854

Reviewed by Andreas Kling.

Initialize boolean flag in constructor and recheck the flag which can be
modified by another thread under mutex.

No new tests, fixes regression that caused layout test crash.

* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::IconDatabase):
(WebCore::IconDatabase::syncThreadMainLoop):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (117624 => 117625)


--- trunk/Source/WebCore/ChangeLog	2012-05-18 21:01:10 UTC (rev 117624)
+++ trunk/Source/WebCore/ChangeLog	2012-05-18 21:10:29 UTC (rev 117625)
@@ -1,3 +1,19 @@
+2012-05-18  Viatcheslav Ostapenko  <[email protected]>
+
+        [Qt] REGRESSION(r117501): It made almost all tests assert in debug mode
+        https://bugs.webkit.org/show_bug.cgi?id=86854
+
+        Reviewed by Andreas Kling.
+
+        Initialize boolean flag in constructor and recheck the flag which can be 
+        modified by another thread under mutex.
+
+        No new tests, fixes regression that caused layout test crash.
+
+        * loader/icon/IconDatabase.cpp:
+        (WebCore::IconDatabase::IconDatabase):
+        (WebCore::IconDatabase::syncThreadMainLoop):
+
 2012-05-18  Christophe Dumez  <[email protected]>
 
         [EFL] Web Intents code is not compiling

Modified: trunk/Source/WebCore/loader/icon/IconDatabase.cpp (117624 => 117625)


--- trunk/Source/WebCore/loader/icon/IconDatabase.cpp	2012-05-18 21:01:10 UTC (rev 117624)
+++ trunk/Source/WebCore/loader/icon/IconDatabase.cpp	2012-05-18 21:10:29 UTC (rev 117625)
@@ -782,6 +782,7 @@
     , m_iconURLImportComplete(false)
     , m_syncThreadHasWorkToDo(false)
     , m_disabledSuddenTerminationForSyncThread(false)
+    , m_retainOrReleaseIconRequested(false)
     , m_initialPruningComplete(false)
     , m_client(defaultClient())
     , m_imported(false)
@@ -1419,7 +1420,10 @@
 
         if (m_retainOrReleaseIconRequested) {
             MutexLocker locker(m_urlAndIconLock);
-            performPendingRetainAndReleaseOperations();
+            // Previous flag check was done outside of the lock and flag could be changed by another thread.
+            // Do not move mutex outside to avoid unnecessary locking on every loop, but recheck the flag under mutex.
+            if (m_retainOrReleaseIconRequested)
+                performPendingRetainAndReleaseOperations();
         }
         
         bool didAnyWork = true;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to