[evolution-data-server/gnome-3-8] Bug #697598 - [imapx] Freeze due to calling thread join from main thread



commit 5cffb1b814c631d16e5a4e6d78df1e3d5914d66d
Author: Milan Crha <mcrha redhat com>
Date:   Thu Jun 27 16:38:49 2013 +0200

    Bug #697598 - [imapx] Freeze due to calling thread join from main thread

 camel/camel-imapx-server.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index a791a44..84d7611 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -6963,11 +6963,11 @@ imapx_parser_thread (gpointer d)
        return NULL;
 }
 
-static gboolean
+static gpointer
 join_helper (gpointer thread)
 {
        g_thread_join (thread);
-       return FALSE;
+       return NULL;
 }
 
 static void
@@ -7039,12 +7039,12 @@ imapx_server_dispose (GObject *object)
        QUEUE_UNLOCK (server);
 
        if (server->parser_thread) {
-               if (server->parser_thread == g_thread_self ())
-                       /* Prioritize ahead of GTK+ redraws. */
-                       g_idle_add_full (
-                               G_PRIORITY_HIGH_IDLE,
-                               &join_helper, server->parser_thread, NULL);
-               else
+               if (server->parser_thread == g_thread_self ()) {
+                       GThread *thread;
+
+                       thread = g_thread_new (NULL, join_helper, server->parser_thread);
+                       g_thread_unref (thread);
+               } else
                        g_thread_join (server->parser_thread);
                server->parser_thread = NULL;
        }


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