summaryrefslogtreecommitdiff
path: root/dbus/dbus-sysdeps-win.c
diff options
context:
space:
mode:
Diffstat (limited to 'dbus/dbus-sysdeps-win.c')
-rw-r--r--dbus/dbus-sysdeps-win.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c
index e30e92fe..397520af 100644
--- a/dbus/dbus-sysdeps-win.c
+++ b/dbus/dbus-sysdeps-win.c
@@ -1872,14 +1872,15 @@ _dbus_sleep_milliseconds (int milliseconds)
/**
- * Get current time, as in gettimeofday().
+ * Get current time, as in gettimeofday(). Never uses the monotonic
+ * clock.
*
* @param tv_sec return location for number of seconds
* @param tv_usec return location for number of microseconds
*/
void
-_dbus_get_current_time (long *tv_sec,
- long *tv_usec)
+_dbus_get_real_time (long *tv_sec,
+ long *tv_usec)
{
FILETIME ft;
dbus_uint64_t time64;
@@ -1901,6 +1902,20 @@ _dbus_get_current_time (long *tv_sec,
*tv_usec = time64 % 1000000;
}
+/**
+ * Get current time, as in gettimeofday(). Use the monotonic clock if
+ * available, to avoid problems when the system time changes.
+ *
+ * @param tv_sec return location for number of seconds
+ * @param tv_usec return location for number of microseconds
+ */
+void
+_dbus_get_monotonic_time (long *tv_sec,
+ long *tv_usec)
+{
+ /* no implementation yet, fall back to wall-clock time */
+ _dbus_get_real_time (tv_sec, tv_usec);
+}
/**
* signal (SIGPIPE, SIG_IGN);