From: corinna Date: Wed, 30 Jun 2004 15:50:08 +0000 (+0000) Subject: * times.cc (hires_ms::usecs): Reinit timer when system time overflows. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3246d0584162271ff5ba92d81aa6ef8846985829;p=pf3gnuchains%2Fpf3gnuchains3x.git * times.cc (hires_ms::usecs): Reinit timer when system time overflows. --- diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 39af363f78..93858441af 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2004-06-30 Corinna Vinschen + + * times.cc (hires_ms::usecs): Reinit timer when system time overflows. + 2004-06-27 Christopher Faylor * thread.cc (__cygwin_lock_lock): Don't bother locking when there is diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc index 635d05a37e..0674122b17 100644 --- a/winsup/cygwin/times.cc +++ b/winsup/cygwin/times.cc @@ -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;