From 7c3da271419ceeef6601c99dcb5cb5400b7157c4 Mon Sep 17 00:00:00 2001 From: tommi Date: Mon, 20 Mar 2017 03:47:17 -0700 Subject: [PATCH] Add a missing DCHECK to PlatformThread::SetPriority. This DCHECK is for the 'new and improved' way of setting thread priority. What could happen is that code that's migrating over to the new method might still have a lingering SetPriority call, that could incorrectly bind the 'spawned_thread_checker_' to the construction thread. BUG=none Review-Url: https://codereview.webrtc.org/2753423002 Cr-Commit-Position: refs/heads/master@{#17305} --- webrtc/base/platform_thread.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/webrtc/base/platform_thread.cc b/webrtc/base/platform_thread.cc index b4724b99e9..d3a1a037fc 100644 --- a/webrtc/base/platform_thread.cc +++ b/webrtc/base/platform_thread.cc @@ -279,6 +279,7 @@ bool PlatformThread::SetPriority(ThreadPriority priority) { if (run_function_) { // The non-deprecated way of how this function gets called, is that it must // be called on the worker thread itself. + RTC_DCHECK(!thread_checker_.CalledOnValidThread()); RTC_DCHECK(spawned_thread_checker_.CalledOnValidThread()); } else { // In the case of deprecated use of this method, it must be called on the