author | David Rajchenbach-Teller <dteller@mozilla.com> |
Tue, 01 Mar 2016 09:01:22 +0100 | |
changeset 286268 | e9a72b270abbe2e1b5181e352c56677019b918ee |
parent 286267 | f5e475aff6f0f527365894889421b79a4c5d1308 |
child 286269 | af1b34021a320652d4b933d6d38a1d1153a9181d |
push id | 72708 |
push user | dteller@mozilla.com |
push date | Tue, 01 Mar 2016 16:05:29 +0000 |
treeherder | mozilla-inbound@e9a72b270abb [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | froydnj |
bugs | 1252382 |
milestone | 47.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
|
--- a/toolkit/components/terminator/nsTerminator.cpp +++ b/toolkit/components/terminator/nsTerminator.cpp @@ -28,16 +28,22 @@ #include "nsAppDirectoryServiceDefs.h" #include "nsIObserverService.h" #include "nsIPrefService.h" #if defined(MOZ_CRASHREPORTER) #include "nsExceptionHandler.h" #endif +#if defined(XP_WIN) +#include <windows.h> +#else +#include <unistd.h> +#endif + #include "mozilla/ArrayUtils.h" #include "mozilla/Attributes.h" #include "mozilla/DebugOnly.h" #include "mozilla/MemoryChecking.h" #include "mozilla/Preferences.h" #include "mozilla/Services.h" #include "mozilla/UniquePtr.h" #include "mozilla/unused.h" @@ -122,29 +128,32 @@ RunWatchdog(void* arg) // Let's copy and deallocate options, that's one less leak to worry // about. UniquePtr<Options> options((Options*)arg); uint32_t crashAfterTicks = options->crashAfterTicks; options = nullptr; const uint32_t timeToLive = crashAfterTicks; - const PRIntervalTime ticksDuration = PR_MillisecondsToInterval(1000); while (true) { // // We do not want to sleep for the entire duration, // as putting the computer to sleep would suddenly // cause us to timeout on wakeup. // // Rather, we prefer sleeping for at most 1 second // at a time. If the computer sleeps then wakes up, // we have lost at most one second, which is much // more reasonable. // - PR_Sleep(ticksDuration); +#if defined(XP_WIN) + Sleep(1000 /* ms */); +#else + usleep(1000000 /* usec */); +#endif if (gHeartbeat++ < timeToLive) { continue; } // Shutdown is apparently dead. Crash the process. MOZ_CRASH("Shutdown too long, probably frozen, causing a crash."); }