Go back to only using sched_yield on Mac (sigh)

Using sched_yield on Linux seems to be causing RestartingSendStreamPreservesRtpStatesWithRtx/0 to never complete.

BUG=webrtc:7187
TBR=solenberg@webrtc.org

Review-Url: https://codereview.webrtc.org/2732443002
Cr-Commit-Position: refs/heads/master@{#16975}
This commit is contained in:
tommi 2017-03-02 08:08:59 -08:00 committed by Commit bot
parent 4c6df8893e
commit 0473b1dc03

View File

@ -261,13 +261,11 @@ void PlatformThread::Run() {
SleepEx(0, true);
} while (!stop_);
#else
#if defined(UNDEFINED_SANITIZER) || defined(WEBRTC_ANDROID)
// UBSAN and Android don't like |sched_yield()| that much.
#if defined(WEBRTC_MAC)
sched_yield();
#else
static const struct timespec ts_null = {0};
nanosleep(&ts_null, nullptr);
#else // !(defined(UNDEFINED_SANITIZER) || defined(WEBRTC_ANDROID))
// Mac and Linux show better performance with sched_yield.
sched_yield();
#endif
} while (!AtomicOps::AcquireLoad(&stop_flag_));
#endif // defined(WEBRTC_WIN)