* times.cc (hires_ms::usecs): Reinit timer when system time overflows.
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
| @@ -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; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user