Mutex: remove Abseil static initializer.

The change adds conditional inclusion of mutex_abseil.h from mutex.h
and conditional referencing of
//third_party/abseil-cpp/absl/synchronization
which introduces a static initializer.

https://webrtc-review.googlesource.com/c/src/+/176230 introduced a
static initializer which broke the Chromium autoroll,
https://chromium-review.googlesource.com/c/chromium/src/+/2230887.
Example failure:
https://ci.chromium.org/p/chromium/builders/try/android-lollipop-arm-rel/34133

TBR=karl@webrtc.org

No-Try: True
Bug: webrtc:11567
Change-Id: Id78af798f34d5d6beaf9f6e0150e6b3ddd31ff4f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176513
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Olga Sharonova <olka@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31451}
This commit is contained in:
Markus Handell
2020-06-05 11:47:40 +02:00
committed by Commit Bot
parent b2f73040fc
commit 8e75bd40e0
4 changed files with 15 additions and 3 deletions

View File

@ -265,6 +265,10 @@ config("common_config") {
defines += [ "WEBRTC_USE_H264" ]
}
if (rtc_use_absl_mutex) {
defines += [ "WEBRTC_ABSL_MUTEX" ]
}
if (rtc_disable_logging) {
defines += [ "RTC_DISABLE_LOGGING" ]
}

View File

@ -25,18 +25,23 @@ rtc_library("mutex") {
sources = [
"mutex.cc",
"mutex.h",
"mutex_abseil.h",
"mutex_critical_section.h",
"mutex_pthread.h",
]
if (rtc_use_absl_mutex) {
sources += [ "mutex_abseil.h" ]
}
deps = [
":yield",
"..:checks",
"..:macromagic",
"../system:unused",
"//third_party/abseil-cpp/absl/base:core_headers",
"//third_party/abseil-cpp/absl/synchronization",
]
if (rtc_use_absl_mutex) {
deps += [ "//third_party/abseil-cpp/absl/synchronization" ]
}
}
rtc_library("rw_lock_wrapper") {

View File

@ -19,7 +19,7 @@
#include "rtc_base/thread_annotations.h"
#if defined(WEBRTC_ABSL_MUTEX)
#include "rtc_base/synchronization/mutex_abseil.h"
#include "rtc_base/synchronization/mutex_abseil.h" // nogncheck
#elif defined(WEBRTC_WIN)
#include "rtc_base/synchronization/mutex_critical_section.h"
#elif defined(WEBRTC_POSIX)

View File

@ -155,6 +155,9 @@ declare_args() {
rtc_use_h264 =
proprietary_codecs && !is_android && !is_ios && !(is_win && !is_clang)
# Enable this flag to make webrtc::Mutex be implemented by absl::Mutex.
rtc_use_absl_mutex = false
# By default, use normal platform audio support or dummy audio, but don't
# use file-based audio playout and record.
rtc_use_dummy_audio_file_devices = false