Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Define DEFAULT_TIMEOUT_EPSILON for cv_timedwaitbt.



details:   https://anonhg.NetBSD.org/src/rev/bca62788a569
branches:  trunk
changeset: 932240:bca62788a569
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun May 03 01:20:37 2020 +0000

description:
Define DEFAULT_TIMEOUT_EPSILON for cv_timedwaitbt.

For now, it is roughly one bintime's worth of ticks.

This is about the smallest difference between wait periods we can
rely on at the moment; in the glorious tickless future we can revisit
this.

diffstat:

 sys/sys/timevar.h |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r 383ad2ed14ec -r bca62788a569 sys/sys/timevar.h
--- a/sys/sys/timevar.h Sun May 03 01:19:47 2020 +0000
+++ b/sys/sys/timevar.h Sun May 03 01:20:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: timevar.h,v 1.40 2020/01/02 15:42:27 thorpej Exp $     */
+/*     $NetBSD: timevar.h,v 1.41 2020/05/03 01:20:37 riastradh Exp $   */
 
 /*
  *  Copyright (c) 2005, 2008 The NetBSD Foundation.
@@ -195,6 +195,12 @@
 extern volatile time_t time_second;    /* current second in the epoch */
 extern volatile time_t time_uptime;    /* system uptime in seconds */
 
+#define        DEFAULT_TIMEOUT_EPSILON                                               \
+       (&(const struct bintime) {                                            \
+               .sec = 0,                                                     \
+               .frac = ((uint64_t)1 << 32)/hz << 32,                         \
+       })
+
 static __inline time_t time_mono_to_wall(time_t t)
 {
 



Home | Main Index | Thread Index | Old Index