[evolution-data-server] Bug #631804 - Aborts with pthread error in imapx_server_dispose()



commit 0a2718cd2bea30a3d73ab911c6e572c341eedab4
Author: David Woodhouse <David Woodhouse intel com>
Date:   Mon Nov 8 15:04:16 2010 +0100

    Bug #631804 - Aborts with pthread error in imapx_server_dispose()

 camel/providers/imapx/camel-imapx-server.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index f60fc5a..d8d72dd 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -4969,6 +4969,14 @@ imapx_server_constructed (GObject *object)
 	if (class->tagprefix > 'Z')
 		class->tagprefix = 'A';
 }
+
+static gboolean
+join_helper (gpointer thread)
+{
+	g_thread_join (thread);
+	return FALSE;
+}
+
 static void
 imapx_server_dispose (GObject *object)
 {
@@ -4987,7 +4995,10 @@ imapx_server_dispose (GObject *object)
 	QUEUE_UNLOCK (server);
 
 	if (server->parser_thread) {
-		g_thread_join (server->parser_thread);
+		if (server->parser_thread == g_thread_self ())
+			g_idle_add (&join_helper, server->parser_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]