gtestdbus: Use g_timeout_add_seconds() rather than g_timeout_add()

This makes the code a little easier to understand and allows the kernel
a little bit more leeway in scheduling the callback, which is fine
because we don’t need high accuracy here.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2022-11-15 17:51:41 +00:00
parent e8c068db50
commit 19eee4bc41

View File

@ -94,7 +94,7 @@ _g_object_unref_and_wait_weak_notify (gpointer object)
g_idle_add (unref_on_idle, object); g_idle_add (unref_on_idle, object);
/* Make sure we don't block forever */ /* Make sure we don't block forever */
timeout_id = g_timeout_add (30 * 1000, on_weak_notify_timeout, &data); timeout_id = g_timeout_add_seconds (30, on_weak_notify_timeout, &data);
g_main_loop_run (data.loop); g_main_loop_run (data.loop);