From 0a3593c25dbc96b7d66d17ab77fc9984ab2bf245 Mon Sep 17 00:00:00 2001 From: Tommi Date: Wed, 17 Jan 2018 23:30:51 +0100 Subject: [PATCH] Add ScopedAllowBaseSyncPrimitives for DesktopConfigurationMonitor. This is a temporary measure until the synchronization method used in the class, gets fixed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: chromium:796889, chromium:795340 Change-Id: Ie3d394ae42f005e8e0f353d04ea9c1d053ea9fd2 Reviewed-on: https://webrtc-review.googlesource.com/40460 Reviewed-by: Erik Språng Commit-Queue: Tommi Cr-Commit-Position: refs/heads/master@{#21812} --- .../desktop_capture/mac/desktop_configuration_monitor.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/desktop_capture/mac/desktop_configuration_monitor.cc b/modules/desktop_capture/mac/desktop_configuration_monitor.cc index 4eeee32106..922f3ec59c 100644 --- a/modules/desktop_capture/mac/desktop_configuration_monitor.cc +++ b/modules/desktop_capture/mac/desktop_configuration_monitor.cc @@ -11,6 +11,7 @@ #include "modules/desktop_capture/mac/desktop_configuration_monitor.h" #include "modules/desktop_capture/mac/desktop_configuration.h" +#include "rtc_base/event.h" #include "rtc_base/logging.h" #include "system_wrappers/include/event_wrapper.h" @@ -41,6 +42,9 @@ DesktopConfigurationMonitor::~DesktopConfigurationMonitor() { } void DesktopConfigurationMonitor::Lock() { + // TODO(crbug.com/796889, crbug.com/795340): Fix how synchronization is being + // done and avoid blocking waits. + rtc::ScopedAllowBaseSyncPrimitives allow_event_wait; if (!display_configuration_capture_event_->Wait( kDisplayConfigurationEventTimeoutMs)) { RTC_LOG_F(LS_ERROR) << "Event wait timed out."; @@ -70,6 +74,10 @@ void DesktopConfigurationMonitor::DisplaysReconfigured( // If this is the first display to start reconfiguring then wait on // |display_configuration_capture_event_| to block the capture thread // from accessing display memory until the reconfiguration completes. + + // TODO(crbug.com/796889, crbug.com/795340): Fix how synchronization is + // being done and avoid blocking waits. + rtc::ScopedAllowBaseSyncPrimitives allow_event_wait; if (!display_configuration_capture_event_->Wait( kDisplayConfigurationEventTimeoutMs)) { RTC_LOG_F(LS_ERROR) << "Event wait timed out.";