Clarify expectation on GlobalLock

Merge GlobalLock and GlobalLockPod, make member private.
annotate creation of all GlobalLocks with ABSL_CONST_INIT

Bug: None
Change-Id: I29abcc86796ec0e45b15df7d26392309d1bf7324
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156303
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29447}
This commit is contained in:
Danil Chapovalov
2019-10-10 11:12:15 +02:00
committed by Commit Bot
parent 3c918b1af8
commit 5740f3e2b8
12 changed files with 36 additions and 29 deletions

View File

@ -26,6 +26,7 @@
#undef DS
#endif
#include "absl/base/attributes.h"
#include "rtc_base/critical_section.h"
#include "rtc_base/logging.h"
#include "rtc_base/strings/string_builder.h"
@ -91,7 +92,7 @@ struct SignalHandlerOutputState {
};
// Global lock to ensure only one thread gets interrupted at a time.
rtc::GlobalLockPod g_signal_handler_lock;
ABSL_CONST_INIT rtc::GlobalLock g_signal_handler_lock;
// Argument passed to the ThreadSignalHandler() from the sampling thread to the
// sampled (stopped) thread. This value is set just before sending signal to the
// thread and reset when handler is done.