[PATCH 2/2] revert new event-loop code for timers

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

 



Was causing sporadic crashes.
Also cause compatibility problems with RHEL 6.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/event-loop.c | 51 ---------------------------------------------------
 1 file changed, 51 deletions(-)

diff --git a/server/event-loop.c b/server/event-loop.c
index 9eae913..4738ed9 100644
--- a/server/event-loop.c
+++ b/server/event-loop.c
@@ -24,56 +24,6 @@
 
 #include "red-common.h"
 
-#if GLIB_CHECK_VERSION(2, 34, 0)
-struct SpiceTimer {
-    GSource source;
-};
-
-static gboolean
-spice_timer_dispatch(GSource     *source,
-                     GSourceFunc  callback,
-                     gpointer     user_data)
-{
-    SpiceTimerFunc func = (SpiceTimerFunc) callback;
-
-    func(user_data);
-    /* timer might be free after func(), don't touch */
-
-    return FALSE;
-}
-
-static GSourceFuncs spice_timer_funcs = {
-    .dispatch = spice_timer_dispatch,
-};
-
-static SpiceTimer* timer_add(const SpiceCoreInterfaceInternal *iface,
-                             SpiceTimerFunc func, void *opaque)
-{
-    SpiceTimer *timer = (SpiceTimer *) g_source_new(&spice_timer_funcs, sizeof(SpiceTimer));
-
-    g_source_set_callback(&timer->source, (GSourceFunc) func, opaque, NULL);
-
-    g_source_attach(&timer->source, iface->main_context);
-
-    return timer;
-}
-
-static void timer_cancel(SpiceTimer *timer)
-{
-    g_source_set_ready_time(&timer->source, -1);
-}
-
-static void timer_start(SpiceTimer *timer, uint32_t ms)
-{
-    g_source_set_ready_time(&timer->source, g_get_monotonic_time() + ms * 1000u);
-}
-
-static void timer_remove(SpiceTimer *timer)
-{
-    g_source_destroy(&timer->source);
-    g_source_unref(&timer->source);
-}
-#else
 struct SpiceTimer {
     GMainContext *context;
     SpiceTimerFunc func;
@@ -130,7 +80,6 @@ static void timer_remove(SpiceTimer *timer)
     spice_assert(timer->source == NULL);
     free(timer);
 }
-#endif
 
 struct SpiceWatch {
     GMainContext *context;
-- 
2.5.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]