replay: Remove some goto statement

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
This commit is contained in:
Frediano Ziglio 2019-07-22 21:06:40 +01:00
parent 32ee52df16
commit 3af64b61dc

View File

@ -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 (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());
}
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());
end:
pthread_mutex_unlock(&mutex);
}