Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Unified Diff: webrtc/base/platform_thread.cc

Issue 2732443002: Go back to only using sched_yield on Mac (sigh) (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/platform_thread.cc
diff --git a/webrtc/base/platform_thread.cc b/webrtc/base/platform_thread.cc
index afacfdca2d22c8945fb4274fdfa506f2a7cfad0e..b17c30105a3ce0f0637663d8fcafeb4d3ec82fcf 100644
--- a/webrtc/base/platform_thread.cc
+++ b/webrtc/base/platform_thread.cc
@@ -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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698