Add a race-checking mechanism.
Permits CHECKing/DCHECKing that methods are being accessed in a
thread-safe manner, even if they are not used by one single thread
(thread pools such as VideoToolbox OK).
BUG=
R=danilchap@webrtc.org, tommi@webrtc.org
Review URL: https://codereview.webrtc.org/2097403002 .
Cr-Commit-Position: refs/heads/master@{#13358}
diff --git a/webrtc/common_video/incoming_video_stream.cc b/webrtc/common_video/incoming_video_stream.cc
index 2ab3e84..ed7b9ea 100644
--- a/webrtc/common_video/incoming_video_stream.cc
+++ b/webrtc/common_video/incoming_video_stream.cc
@@ -49,9 +49,7 @@
}
void IncomingVideoStream::OnFrame(const VideoFrame& video_frame) {
- // Most of the time we'll be on a decoder thread here, but when using
- // VideoToolbox on iOS, we'll get called on a thread from a thread pool.
-
+ RTC_CHECK_RUNS_SERIALIZED(&decoder_race_checker_);
// Hand over or insert frame.
rtc::CritScope csB(&buffer_critsect_);
if (render_buffers_->AddFrame(video_frame) == 1) {