Title: [276961] branches/safari-612.1.13-branch/Source/WebCore
Revision
276961
Author
rubent...@apple.com
Date
2021-05-04 09:43:33 -0700 (Tue, 04 May 2021)

Log Message

Cherry-pick r276893. rdar://problem/77510428

    REGRESSION (r276633): fast/mediastream/media-stream-track-interrupted.html is consistently timing out
    https://bugs.webkit.org/show_bug.cgi?id=225204
    <rdar://problem/77338070>

    Reviewed by Eric Carlson.

    Reverting to RecursiveLock since resuming a unit will make it notify to unmute sources.
    Sources will want to restart audio, thus restarting the unit synchronously.
    This triggers the unit to tell its clients that it is restarting, which creates a dead lock.
    We should probably update the code to change this, but as a short term fix, we revert to a RecursiveLock.

    Covered by fast/mediastream/media-stream-track-interrupted.html no longer timing out.

    * platform/mediastream/mac/BaseAudioSharedUnit.cpp:
    (WebCore::BaseAudioSharedUnit::audioSamplesAvailable):
    * platform/mediastream/mac/BaseAudioSharedUnit.h:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276893 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-612.1.13-branch/Source/WebCore/ChangeLog (276960 => 276961)


--- branches/safari-612.1.13-branch/Source/WebCore/ChangeLog	2021-05-04 16:37:35 UTC (rev 276960)
+++ branches/safari-612.1.13-branch/Source/WebCore/ChangeLog	2021-05-04 16:43:33 UTC (rev 276961)
@@ -1,3 +1,46 @@
+2021-05-04  Russell Epstein  <repst...@apple.com>
+
+        Cherry-pick r276893. rdar://problem/77510428
+
+    REGRESSION (r276633): fast/mediastream/media-stream-track-interrupted.html is consistently timing out
+    https://bugs.webkit.org/show_bug.cgi?id=225204
+    <rdar://problem/77338070>
+    
+    Reviewed by Eric Carlson.
+    
+    Reverting to RecursiveLock since resuming a unit will make it notify to unmute sources.
+    Sources will want to restart audio, thus restarting the unit synchronously.
+    This triggers the unit to tell its clients that it is restarting, which creates a dead lock.
+    We should probably update the code to change this, but as a short term fix, we revert to a RecursiveLock.
+    
+    Covered by fast/mediastream/media-stream-track-interrupted.html no longer timing out.
+    
+    * platform/mediastream/mac/BaseAudioSharedUnit.cpp:
+    (WebCore::BaseAudioSharedUnit::audioSamplesAvailable):
+    * platform/mediastream/mac/BaseAudioSharedUnit.h:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-05-03  Youenn Fablet  <you...@apple.com>
+
+            REGRESSION (r276633): fast/mediastream/media-stream-track-interrupted.html is consistently timing out
+            https://bugs.webkit.org/show_bug.cgi?id=225204
+            <rdar://problem/77338070>
+
+            Reviewed by Eric Carlson.
+
+            Reverting to RecursiveLock since resuming a unit will make it notify to unmute sources.
+            Sources will want to restart audio, thus restarting the unit synchronously.
+            This triggers the unit to tell its clients that it is restarting, which creates a dead lock.
+            We should probably update the code to change this, but as a short term fix, we revert to a RecursiveLock.
+
+            Covered by fast/mediastream/media-stream-track-interrupted.html no longer timing out.
+
+            * platform/mediastream/mac/BaseAudioSharedUnit.cpp:
+            (WebCore::BaseAudioSharedUnit::audioSamplesAvailable):
+            * platform/mediastream/mac/BaseAudioSharedUnit.h:
+
 2021-05-01  Antti Koivisto  <an...@apple.com>
 
         Share style resolvers between author shadow trees with identical style

Modified: branches/safari-612.1.13-branch/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.cpp (276960 => 276961)


--- branches/safari-612.1.13-branch/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.cpp	2021-05-04 16:37:35 UTC (rev 276960)
+++ branches/safari-612.1.13-branch/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.cpp	2021-05-04 16:43:33 UTC (rev 276961)
@@ -216,11 +216,12 @@
 
 void BaseAudioSharedUnit::audioSamplesAvailable(const MediaTime& time, const PlatformAudioData& data, const AudioStreamDescription& description, size_t numberOfFrames)
 {
+    // We hold the lock here since adding/removing clients can only happen in main thread.
+    auto locker = holdLock(m_clientsLock);
+
     // For performance reasons, we forbid heap allocations while doing rendering on the capture audio thread.
     ForbidMallocUseForCurrentThreadScope forbidMallocUse;
 
-    // We hold the lock here since adding/removing clients can only happen in main thread.
-    auto locker = holdLock(m_clientsLock);
     for (auto* client : m_clients) {
         if (client->isProducingData())
             client->audioSamplesAvailable(time, data, description, numberOfFrames);

Modified: branches/safari-612.1.13-branch/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.h (276960 => 276961)


--- branches/safari-612.1.13-branch/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.h	2021-05-04 16:37:35 UTC (rev 276960)
+++ branches/safari-612.1.13-branch/Source/WebCore/platform/mediastream/mac/BaseAudioSharedUnit.h	2021-05-04 16:43:33 UTC (rev 276961)
@@ -30,8 +30,8 @@
 #include "RealtimeMediaSourceCapabilities.h"
 #include <wtf/Function.h>
 #include <wtf/HashSet.h>
-#include <wtf/Lock.h>
 #include <wtf/MediaTime.h>
+#include <wtf/RecursiveLockAdapter.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -103,7 +103,7 @@
     int32_t m_producingCount { 0 };
 
     HashSet<CoreAudioCaptureSource*> m_clients;
-    mutable Lock m_clientsLock;
+    mutable RecursiveLock m_clientsLock;
 };
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to