            // Only pay attention to frame updates.
            if (status != kCGDisplayStreamFrameStatusFrameComplete)
              return;
-@@ -963,7 +984,12 @@ void ScreenRefresh(CGRectCount count,
+@@ -672,7 +692,12 @@ bool ScreenCapturerMac::RegisterRefreshAndMoveHandlers() {
            if (count != 0) {
              // According to CGDisplayStream.h, it's safe to call
              // CGDisplayStreamStop() from within the callback.
 -            ScreenRefresh(count, rects, display_origin);
-+            manager->ReaderLock();
++            manager->GetLock()->AcquireLockShared();
 +            bool screen_capturer_mac_invalidated = manager->ShouldIgnoreUpdates();
 +            if (!screen_capturer_mac_invalidated) {
 +              ScreenRefresh(count, rects, display_origin);
 +            }
-+            manager->ReaderUnlock();
++            manager->GetLock()->ReleaseLockShared();
            }
          };
  

diff --git a/modules/desktop_capture/screen_capturer_mac.mm b/modules/desktop_capture/screen_capturer_mac.mm
index 6f2690f28..091d76d6e 100644
--- a/modules/desktop_capture/screen_capturer_mac.mm
+++ b/modules/desktop_capture/screen_capturer_mac.mm
@@ -36,6 +36,7 @@

     RTC_CHECK(unique_id <= unique_id_generator_);
     DisplayStreamWrapper wrapper;
     wrapper.stream = stream;
@@ -69,6 +82,7 @@ class DisplayStreamManager {
   }
 
   void UnregisterActiveStreams() {
