* times.cc (hires_ms::resolution): Make sure resolution is never 0.
(clock_setres): Ditto.
This commit is contained in:
parent
51564c783f
commit
af23d12d33
@ -1,3 +1,8 @@
|
|||||||
|
2011-03-30 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* times.cc (hires_ms::resolution): Make sure resolution is never 0.
|
||||||
|
(clock_setres): Ditto.
|
||||||
|
|
||||||
2011-03-29 Corinna Vinschen <corinna@vinschen.de>
|
2011-03-29 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* cygtls.h (struct _local_storage): Redefine process_ident as wchar_t
|
* cygtls.h (struct _local_storage): Redefine process_ident as wchar_t
|
||||||
|
@ -827,6 +827,10 @@ hires_ms::resolution ()
|
|||||||
period /= 40000L;
|
period /= 40000L;
|
||||||
minperiod = (DWORD) period;
|
minperiod = (DWORD) period;
|
||||||
}
|
}
|
||||||
|
/* The resolution can be as low as 5000 100ns intervals on recent OSes.
|
||||||
|
We have to make sure that the resolution in ms is never 0. */
|
||||||
|
if (!minperiod)
|
||||||
|
minperiod = 1L;
|
||||||
}
|
}
|
||||||
return minperiod;
|
return minperiod;
|
||||||
}
|
}
|
||||||
@ -901,6 +905,10 @@ clock_setres (clockid_t clk_id, struct timespec *tp)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
minperiod = actual / 10000L;
|
minperiod = actual / 10000L;
|
||||||
|
/* The resolution can be as low as 5000 100ns intervals on recent OSes.
|
||||||
|
We have to make sure that the resolution in ms is never 0. */
|
||||||
|
if (!minperiod)
|
||||||
|
minperiod = 1L;
|
||||||
period_set = true;
|
period_set = true;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user