[PATCH spice-server 1/2] replay: Remove some goto statement

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

 



Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/tests/replay.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/server/tests/replay.c b/server/tests/replay.c
index e3ef7bf15..992f26d63 100644
--- a/server/tests/replay.c
+++ b/server/tests/replay.c
@@ -116,7 +116,7 @@ static gboolean fill_queue_idle(gpointer user_data)
         if (!cmd) {
             g_async_queue_push(display_queue, GINT_TO_POINTER(-1));
             g_async_queue_push(cursor_queue, GINT_TO_POINTER(-1));
-            goto end;
+            break;
         }
 
         ++ncommands;
@@ -133,7 +133,6 @@ static gboolean fill_queue_idle(gpointer user_data)
         }
     }
 
-end:
     if (!keep) {
         pthread_mutex_lock(&mutex);
         if (fill_source) {
@@ -153,17 +152,12 @@ static void fill_queue(void)
 {
     pthread_mutex_lock(&mutex);
 
-    if (!started)
-        goto end;
-
-    if (fill_source)
-        goto end;
-
-    fill_source = g_idle_source_new();
-    g_source_set_callback(fill_source, fill_queue_idle, NULL, NULL);
-    g_source_attach(fill_source, basic_event_loop_get_context());
+    if (started && fill_source == NULL) {
+        fill_source = g_idle_source_new();
+        g_source_set_callback(fill_source, fill_queue_idle, NULL, NULL);
+        g_source_attach(fill_source, basic_event_loop_get_context());
+    }
 
-end:
     pthread_mutex_unlock(&mutex);
 }
 
-- 
2.20.1

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




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