Title: [86972] trunk/Source/_javascript_Core
Revision
86972
Author
[email protected]
Date
2011-05-20 11:46:19 -0700 (Fri, 20 May 2011)

Log Message

<rdar://problem/9472883> and https://bugs.webkit.org/show_bug.cgi?id=61203
Horrendous bug in callOnMainThreadAndWait

Reviewed by Sam Weinig.

* wtf/MainThread.cpp:
(WTF::dispatchFunctionsFromMainThread): Before signaling the background thread with the
  syncFlag condition, reacquire the mutex first.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (86971 => 86972)


--- trunk/Source/_javascript_Core/ChangeLog	2011-05-20 18:39:14 UTC (rev 86971)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-05-20 18:46:19 UTC (rev 86972)
@@ -1,3 +1,14 @@
+2011-05-20  Brady Eidson  <[email protected]>
+
+        Reviewed by Sam Weinig.
+
+        <rdar://problem/9472883> and https://bugs.webkit.org/show_bug.cgi?id=61203
+        Horrendous bug in callOnMainThreadAndWait
+
+        * wtf/MainThread.cpp:
+        (WTF::dispatchFunctionsFromMainThread): Before signaling the background thread with the
+          syncFlag condition, reacquire the mutex first.
+
 2011-05-20  Oliver Hunt  <[email protected]>
 
         Reviewed by Sam Weinig.

Modified: trunk/Source/_javascript_Core/wtf/MainThread.cpp (86971 => 86972)


--- trunk/Source/_javascript_Core/wtf/MainThread.cpp	2011-05-20 18:39:14 UTC (rev 86971)
+++ trunk/Source/_javascript_Core/wtf/MainThread.cpp	2011-05-20 18:46:19 UTC (rev 86972)
@@ -153,8 +153,10 @@
         }
 
         invocation.function(invocation.context);
-        if (invocation.syncFlag)
+        if (invocation.syncFlag) {
+            MutexLocker locker(mainThreadFunctionQueueMutex());
             invocation.syncFlag->signal();
+        }
 
         // If we are running accumulated functions for too long so UI may become unresponsive, we need to
         // yield so the user input can be processed. Otherwise user may not be able to even close the window.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to