}
static int
-do_expiration_with_current_time (BusExpireList *list,
- long tv_sec,
- long tv_usec)
+do_expiration_with_monotonic_time (BusExpireList *list,
+ long tv_sec,
+ long tv_usec)
{
DBusList *link;
int next_interval, min_wait_time, items_to_expire;
{
long tv_sec, tv_usec;
- _dbus_get_current_time (&tv_sec, &tv_usec);
+ _dbus_get_monotonic_time (&tv_sec, &tv_usec);
- next_interval = do_expiration_with_current_time (list, tv_sec, tv_usec);
+ next_interval = do_expiration_with_monotonic_time (list, tv_sec, tv_usec);
}
bus_expire_timeout_set_interval (list->timeout, next_interval);
return _dbus_list_find_last (&list->items, item) != NULL;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
typedef struct
{
test_expire_func, NULL);
_dbus_assert (list != NULL);
- _dbus_get_current_time (&tv_sec, &tv_usec);
+ _dbus_get_monotonic_time (&tv_sec, &tv_usec);
tv_sec_not_expired = tv_sec;
tv_usec_not_expired = tv_usec;
_dbus_assert_not_reached ("out of memory");
next_interval =
- do_expiration_with_current_time (list, tv_sec_not_expired,
- tv_usec_not_expired);
+ do_expiration_with_monotonic_time (list, tv_sec_not_expired,
+ tv_usec_not_expired);
_dbus_assert (item->expire_count == 0);
_dbus_verbose ("next_interval = %d\n", next_interval);
_dbus_assert (next_interval == 1);
next_interval =
- do_expiration_with_current_time (list, tv_sec_expired,
- tv_usec_expired);
+ do_expiration_with_monotonic_time (list, tv_sec_expired,
+ tv_usec_expired);
_dbus_assert (item->expire_count == 1);
_dbus_verbose ("next_interval = %d\n", next_interval);
_dbus_assert (next_interval == -1);
next_interval =
- do_expiration_with_current_time (list, tv_sec_past,
- tv_usec_past);
+ do_expiration_with_monotonic_time (list, tv_sec_past,
+ tv_usec_past);
_dbus_assert (item->expire_count == 1);
_dbus_verbose ("next_interval = %d\n", next_interval);
_dbus_assert (next_interval == 1000 + EXPIRE_AFTER);
return result;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */