Bug 1492929 - Disable ChaosMode sleep delay on Windows. r=froydnj
authorChristian Holler <choller@mozilla.com>
Fri, 21 Sep 2018 12:38:43 +0000
changeset 437657 6b44a1ec79c5a9fc0bec329e0cdcde830facb84c
parent 437656 4563026056a63441df0f67d77cc59aee0e44d6fd
child 437658 29972a9da2511f68c60bb58db17a01b789c985b6
push id69746
push usercholler@mozilla.com
push dateFri, 21 Sep 2018 12:40:13 +0000
treeherderautoland@6b44a1ec79c5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1492929
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1492929 - Disable ChaosMode sleep delay on Windows. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D6449
xpcom/threads/ThreadDelay.cpp
--- a/xpcom/threads/ThreadDelay.cpp
+++ b/xpcom/threads/ThreadDelay.cpp
@@ -21,16 +21,17 @@ DelayForChaosMode(ChaosFeature aFeature,
   if (!ChaosMode::isActive(aFeature)) {
     return;
   }
 
   MOZ_ASSERT(aMicrosecondLimit <= 1000);
 #if defined(XP_WIN)
   // Windows doesn't support sleeping at less than millisecond resolution.
   // We could spin here, or we could just sleep for one millisecond.
-  ::Sleep(1);
+  // Sleeping for a full millisecond causes heavy delays, so we don't do anything
+  // here for now until we have found a good way to sleep more precisely here.
 #else
   const uint32_t duration = ChaosMode::randomUint32LessThan(aMicrosecondLimit);
   ::usleep(duration);
 #endif
 }
 
 } // namespace mozilla