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:

committed by
Commit Bot

parent
b2f73040fc
commit
8e75bd40e0
4
BUILD.gn
4
BUILD.gn
@ -265,6 +265,10 @@ config("common_config") {
|
|||||||
defines += [ "WEBRTC_USE_H264" ]
|
defines += [ "WEBRTC_USE_H264" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rtc_use_absl_mutex) {
|
||||||
|
defines += [ "WEBRTC_ABSL_MUTEX" ]
|
||||||
|
}
|
||||||
|
|
||||||
if (rtc_disable_logging) {
|
if (rtc_disable_logging) {
|
||||||
defines += [ "RTC_DISABLE_LOGGING" ]
|
defines += [ "RTC_DISABLE_LOGGING" ]
|
||||||
}
|
}
|
||||||
|
@ -25,18 +25,23 @@ rtc_library("mutex") {
|
|||||||
sources = [
|
sources = [
|
||||||
"mutex.cc",
|
"mutex.cc",
|
||||||
"mutex.h",
|
"mutex.h",
|
||||||
"mutex_abseil.h",
|
|
||||||
"mutex_critical_section.h",
|
"mutex_critical_section.h",
|
||||||
"mutex_pthread.h",
|
"mutex_pthread.h",
|
||||||
]
|
]
|
||||||
|
if (rtc_use_absl_mutex) {
|
||||||
|
sources += [ "mutex_abseil.h" ]
|
||||||
|
}
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
":yield",
|
":yield",
|
||||||
"..:checks",
|
"..:checks",
|
||||||
"..:macromagic",
|
"..:macromagic",
|
||||||
"../system:unused",
|
"../system:unused",
|
||||||
"//third_party/abseil-cpp/absl/base:core_headers",
|
"//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") {
|
rtc_library("rw_lock_wrapper") {
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "rtc_base/thread_annotations.h"
|
#include "rtc_base/thread_annotations.h"
|
||||||
|
|
||||||
#if defined(WEBRTC_ABSL_MUTEX)
|
#if defined(WEBRTC_ABSL_MUTEX)
|
||||||
#include "rtc_base/synchronization/mutex_abseil.h"
|
#include "rtc_base/synchronization/mutex_abseil.h" // nogncheck
|
||||||
#elif defined(WEBRTC_WIN)
|
#elif defined(WEBRTC_WIN)
|
||||||
#include "rtc_base/synchronization/mutex_critical_section.h"
|
#include "rtc_base/synchronization/mutex_critical_section.h"
|
||||||
#elif defined(WEBRTC_POSIX)
|
#elif defined(WEBRTC_POSIX)
|
||||||
|
@ -155,6 +155,9 @@ declare_args() {
|
|||||||
rtc_use_h264 =
|
rtc_use_h264 =
|
||||||
proprietary_codecs && !is_android && !is_ios && !(is_win && !is_clang)
|
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
|
# By default, use normal platform audio support or dummy audio, but don't
|
||||||
# use file-based audio playout and record.
|
# use file-based audio playout and record.
|
||||||
rtc_use_dummy_audio_file_devices = false
|
rtc_use_dummy_audio_file_devices = false
|
||||||
|
Reference in New Issue
Block a user