From 65f47275cbb5ad3aa5146b9e75afa9894467daff Mon Sep 17 00:00:00 2001 From: Taylor Brandstetter Date: Tue, 28 Jun 2016 10:46:35 -0700 Subject: [PATCH] Fixing race condition in IncomingVideoStream. This really only happens on the memcheck bot. But the issue is that the render thread may be started before the timer is started on the main thread, which incorrectly attaches the timer to the render thread. Then a thread check assertion occurs when the timer is stopped on the main thread. Simply starting the timer before starting the render thread fixes this. BUG=webrtc:6062 TBR=tommi@webrtc.org Review URL: https://codereview.webrtc.org/2105013002 . Cr-Commit-Position: refs/heads/master@{#13317} --- webrtc/common_video/incoming_video_stream.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webrtc/common_video/incoming_video_stream.cc b/webrtc/common_video/incoming_video_stream.cc index f5a52fcba3..2ab3e84453 100644 --- a/webrtc/common_video/incoming_video_stream.cc +++ b/webrtc/common_video/incoming_video_stream.cc @@ -30,9 +30,9 @@ IncomingVideoStream::IncomingVideoStream( render_thread_checker_.DetachFromThread(); + deliver_buffer_event_->StartTimer(false, kEventStartupTimeMs); incoming_render_thread_.Start(); incoming_render_thread_.SetPriority(rtc::kRealtimePriority); - deliver_buffer_event_->StartTimer(false, kEventStartupTimeMs); } IncomingVideoStream::~IncomingVideoStream() {