Title: [121165] branches/safari-536-branch/Source/WebCore
Revision
121165
Author
[email protected]
Date
2012-06-25 10:38:32 -0700 (Mon, 25 Jun 2012)

Log Message

Rollout r121034 -> <rdar://problem/11718988>

Modified Paths

Diff

Modified: branches/safari-536-branch/Source/WebCore/ChangeLog (121164 => 121165)


--- branches/safari-536-branch/Source/WebCore/ChangeLog	2012-06-25 17:36:38 UTC (rev 121164)
+++ branches/safari-536-branch/Source/WebCore/ChangeLog	2012-06-25 17:38:32 UTC (rev 121165)
@@ -1,5 +1,10 @@
 2012-06-22  Lucas Forschler  <[email protected]>
 
+    Rollout 121034
+    This was 120954 from trunk.
+    
+2012-06-22  Lucas Forschler  <[email protected]>
+
     Merge 120954
 
     2012-06-21  Brady Eidson  <[email protected]>

Modified: branches/safari-536-branch/Source/WebCore/platform/RunLoop.cpp (121164 => 121165)


--- branches/safari-536-branch/Source/WebCore/platform/RunLoop.cpp	2012-06-25 17:36:38 UTC (rev 121164)
+++ branches/safari-536-branch/Source/WebCore/platform/RunLoop.cpp	2012-06-25 17:38:32 UTC (rev 121165)
@@ -57,42 +57,15 @@
 
 void RunLoop::performWork()
 {
-    // It is important to handle the functions in the queue one at a time because while inside one of these
-    // functions we might re-enter RunLoop::performWork() and we need to be able to pick up where we left off.
-    // See http://webkit.org/b/89590 for more discussion.
-
-    // One possible scenario when handling the function queue is as follows:
-    // - RunLoop::performWork() is invoked with 1 function on the queue
-    // - Handling that function results in 1 more function being enqueued
-    // - Handling that one results in yet another being enqueued
-    // - And so on
-    //
-    // In this situation one invocation of performWork() never returns so all other event sources are blocked.
-    // By only handling up to the number of functions that were in the queue when performWork() is called
-    // we guarantee to occasionally return from the run loop so other event sources will be allowed to spin.
-
     Function<void()> function;
-    size_t functionsToHandle = 0;
+    
+    while (true) {
+        // It is important to handle the functions in the queue one at a time because while inside one of these
+        // functions we might re-enter RunLoop::performWork() and we need to be able to pick up where we left off.
+        // See http://webkit.org/b/89590 for more discussion.
 
-    {
-        MutexLocker locker(m_functionQueueLock);
-        functionsToHandle = m_functionQueue.size();
-
-        if (m_functionQueue.isEmpty())
-            return;
-
-        function = m_functionQueue.takeFirst();
-    }
-
-    function();
-
-    for (size_t functionsHandled = 1; functionsHandled < functionsToHandle; ++functionsHandled) {
         {
             MutexLocker locker(m_functionQueueLock);
-
-            // Even if we start off with N functions to handle and we've only handled less than N functions, the queue
-            // still might be empty because those functions might have been handled in an inner RunLoop::performWork().
-            // In that case we should bail here.
             if (m_functionQueue.isEmpty())
                 break;
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to