aboutsummaryrefslogtreecommitdiff
path: root/libsylph/socket.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2009-09-25 09:42:39 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2009-09-25 09:42:39 +0000
commit1ff05553158408570a7cd548fdcdf4ec7be07f5d (patch)
tree3667621c49e8ba4006ad3fd6e668292b3ffb83cb /libsylph/socket.c
parentcd87d5c742ab84c90e4338d46a23f17f9dbf9d2b (diff)
fixed the handling of GDK thread lock.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2258 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/socket.c')
-rw-r--r--libsylph/socket.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libsylph/socket.c b/libsylph/socket.c
index 5e6df275..5b2ea960 100644
--- a/libsylph/socket.c
+++ b/libsylph/socket.c
@@ -87,11 +87,11 @@ struct _SockConnectData {
SockLookupData *lookup_data;
GIOChannel *channel;
guint io_tag;
-#else
+#elif USE_THREADS
gint flag;
GThread *thread;
SockInfo *sock;
-#endif
+#endif /* G_OS_UNIX */
SockConnectFunc func;
gpointer data;
};
@@ -1323,8 +1323,8 @@ static gint sock_get_address_info_async_cancel(SockLookupData *lookup_data)
return 0;
}
-#else /* G_OS_UNIX */
-
+#else /* !G_OS_UNIX */
+#if USE_THREADS
static gpointer sock_connect_async_func(gpointer data)
{
SockConnectData *conn_data = (SockConnectData *)data;
@@ -1382,7 +1382,7 @@ gint sock_connect_async_wait(gint id, SockInfo **sock)
g_print("sock_connect_async_wait: waiting thread\n");
while (conn_data->flag == 0)
- g_main_context_iteration(NULL, TRUE);
+ event_loop_iterate();
g_print("sock_connect_async_wait: flagged\n");
g_thread_join(conn_data->thread);
@@ -1394,7 +1394,10 @@ gint sock_connect_async_wait(gint id, SockInfo **sock)
conn_data);
g_free(conn_data->hostname);
g_free(conn_data);
+
+ return 0;
}
+#endif /* USE_THREADS */
#endif /* G_OS_UNIX */