Bug 560717 Linux FPE running make check r=bsmedberg
authorGinn Chen <ginn.chen@sun.com>
Wed, 28 Apr 2010 17:40:03 +0800
changeset 41457 43e12453336f67dc78ef6cf15c923bc768416d29
parent 41456 fafbc4518ca1862fa6eb333c4ff5dc69fbfe1960
child 41458 f37918b1460163cca7ab7536f789d4bc9342e013
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs560717
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 560717 Linux FPE running make check r=bsmedberg
xpcom/ds/TimeStamp_posix.cpp
--- a/xpcom/ds/TimeStamp_posix.cpp
+++ b/xpcom/ds/TimeStamp_posix.cpp
@@ -44,16 +44,32 @@
 // doesn't mean that a nanosecond is the resolution of TimeDurations
 // obtained with this API; see TimeDuration::Resolution;
 //
 
 #include <time.h>
 
 #include "mozilla/TimeStamp.h"
 
+namespace mozilla {
+
+struct TimeStampInitialization
+{
+  TimeStampInitialization() {
+    TimeStamp::Startup();
+  }
+  ~TimeStampInitialization() {
+    TimeStamp::Shutdown();
+  }
+};
+
+static TimeStampInitialization initOnce;
+
+}
+
 // Estimate of the smallest duration of time we can measure.
 static PRUint64 sResolution;
 static PRUint64 sResolutionSigDigs;
 
 static const PRUint16 kNsPerUs   =       1000;
 static const PRUint64 kNsPerMs   =    1000000;
 static const PRUint64 kNsPerSec  = 1000000000; 
 static const double kNsPerSecd   = 1000000000.0;