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}
This commit is contained in:
Peter Boström
2015-11-24 18:10:24 +01:00
parent b2514725a9
commit c661213a63

View File

@ -202,14 +202,16 @@ void PlatformThread::Run() {
bool PlatformThread::SetPriority(ThreadPriority priority) { bool PlatformThread::SetPriority(ThreadPriority priority) {
RTC_DCHECK(thread_checker_.CalledOnValidThread()); RTC_DCHECK(thread_checker_.CalledOnValidThread());
#if defined(WEBRTC_WIN)
return thread_ && SetThreadPriority(thread_, priority);
#else
if (!thread_) if (!thread_)
return false; return false;
#if defined(WEBRTC_CHROMIUM_BUILD) && defined(WEBRTC_LINUX) #if defined(WEBRTC_WIN)
// TODO(tommi): Switch to the same mechanism as Chromium uses for return SetThreadPriority(thread_, priority);
// changing thread priorities. #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; return true;
#else #else
#ifdef WEBRTC_THREAD_RR #ifdef WEBRTC_THREAD_RR
@ -250,7 +252,6 @@ bool PlatformThread::SetPriority(ThreadPriority priority) {
break; break;
} }
return pthread_setschedparam(thread_, policy, &param) == 0; return pthread_setschedparam(thread_, policy, &param) == 0;
#endif // defined(WEBRTC_CHROMIUM_BUILD) && defined(WEBRTC_LINUX)
#endif // defined(WEBRTC_WIN) #endif // defined(WEBRTC_WIN)
} }