OSDN Git Service

* times.cc (hires_ms::usecs): Reinit timer when system time overflows.
authorcorinna <corinna>
Wed, 30 Jun 2004 15:50:08 +0000 (15:50 +0000)
committercorinna <corinna>
Wed, 30 Jun 2004 15:50:08 +0000 (15:50 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/times.cc

index 39af363..9385844 100644 (file)
@@ -1,3 +1,7 @@
+2004-06-30  Corinna Vinschen  <corinna@vinschen.de>
+
+       * times.cc (hires_ms::usecs): Reinit timer when system time overflows.
+
 2004-06-27  Christopher Faylor  <me@cgf.cx>
 
        * thread.cc (__cygwin_lock_lock): Don't bother locking when there is
index 635d05a..0674122 100644 (file)
@@ -658,6 +658,12 @@ hires_ms::usecs (bool justdelta)
   if (!minperiod) /* NO_COPY variable */
     prime ();
   DWORD now = timeGetTime ();
+  if (now <= initime_ms)
+    {
+      inited = 0;
+      prime ();
+      now = timeGetTime ();
+    }
   // FIXME: Not sure how this will handle the 49.71 day wrap around
   LONGLONG res = initime_us.QuadPart + ((LONGLONG) (now - initime_ms) * 1000);
   return res;