From 7d842d660ef5e053da0305bc1d9405fb070b05dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Bostr=C3=B6m?= Date: Tue, 24 Nov 2015 18:23:24 +0100 Subject: [PATCH] Move thread_ conditional back under defines. Unbreaks Windows builds. BUG= TBR=tommi@webrtc.org Review URL: https://codereview.webrtc.org/1476543002 . Cr-Commit-Position: refs/heads/master@{#10778} --- webrtc/base/platform_thread.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webrtc/base/platform_thread.cc b/webrtc/base/platform_thread.cc index a0e37efc8e..af90672a81 100644 --- a/webrtc/base/platform_thread.cc +++ b/webrtc/base/platform_thread.cc @@ -202,10 +202,8 @@ void PlatformThread::Run() { bool PlatformThread::SetPriority(ThreadPriority priority) { RTC_DCHECK(thread_checker_.CalledOnValidThread()); - if (!thread_) - return false; #if defined(WEBRTC_WIN) - return SetThreadPriority(thread_, priority); + return thread_ && SetThreadPriority(thread_, priority); #elif defined(__native_client__) // Setting thread priorities is not supported in NaCl. return true; @@ -214,6 +212,8 @@ bool PlatformThread::SetPriority(ThreadPriority priority) { // thread priorities. return true; #else + if (!thread_) + return false; #ifdef WEBRTC_THREAD_RR const int policy = SCHED_RR; #else