From c661213a63afaaf9736aa3e1940e96c9fdf87117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Bostr=C3=B6m?= Date: Tue, 24 Nov 2015 18:10:24 +0100 Subject: [PATCH] Skip setting thread priorities in NaCl. Fixes Chromium build since PlatformThread is now built under NaCl. BUG= R=tommi@webrtc.org Review URL: https://codereview.webrtc.org/1472083002 . Cr-Commit-Position: refs/heads/master@{#10777} --- webrtc/base/platform_thread.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/webrtc/base/platform_thread.cc b/webrtc/base/platform_thread.cc index 02ec3af29c..a0e37efc8e 100644 --- a/webrtc/base/platform_thread.cc +++ b/webrtc/base/platform_thread.cc @@ -202,14 +202,16 @@ void PlatformThread::Run() { bool PlatformThread::SetPriority(ThreadPriority priority) { RTC_DCHECK(thread_checker_.CalledOnValidThread()); -#if defined(WEBRTC_WIN) - return thread_ && SetThreadPriority(thread_, priority); -#else if (!thread_) return false; -#if defined(WEBRTC_CHROMIUM_BUILD) && defined(WEBRTC_LINUX) - // TODO(tommi): Switch to the same mechanism as Chromium uses for - // changing thread priorities. +#if defined(WEBRTC_WIN) + return SetThreadPriority(thread_, priority); +#elif defined(__native_client__) + // Setting thread priorities is not supported in NaCl. + return true; +#elif defined(WEBRTC_CHROMIUM_BUILD) && defined(WEBRTC_LINUX) + // TODO(tommi): Switch to the same mechanism as Chromium uses for changing + // thread priorities. return true; #else #ifdef WEBRTC_THREAD_RR @@ -250,7 +252,6 @@ bool PlatformThread::SetPriority(ThreadPriority priority) { break; } return pthread_setschedparam(thread_, policy, ¶m) == 0; -#endif // defined(WEBRTC_CHROMIUM_BUILD) && defined(WEBRTC_LINUX) #endif // defined(WEBRTC_WIN) }