[libgda] GdaBrowser: correction in threads usage
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] GdaBrowser: correction in threads usage
- Date: Sun, 5 May 2013 14:31:32 +0000 (UTC)
commit b703e2fe6db317e1efcbae945480460b4a995110
Author: Vivien Malerba <malerba gnome-db org>
Date: Sun May 5 16:02:33 2013 +0200
GdaBrowser: correction in threads usage
tools/browser/browser-connection.c | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/tools/browser/browser-connection.c b/tools/browser/browser-connection.c
index 78a5aad..dd81706 100644
--- a/tools/browser/browser-connection.c
+++ b/tools/browser/browser-connection.c
@@ -478,7 +478,9 @@ wrapper_meta_struct_sync (BrowserConnection *bcnc, GError **error)
return GINT_TO_POINTER (retval ? 2 : 1);
}
-
+/*
+ * executed in main thread
+ */
static void
meta_changed_cb (G_GNUC_UNUSED GdaThreadWrapper *wrapper,
G_GNUC_UNUSED GdaMetaStore *store,
@@ -525,6 +527,9 @@ browser_connection_meta_data_changed (BrowserConnection *bcnc)
meta_changed_cb (NULL, NULL, NULL, 0, NULL, NULL, bcnc);
}
+/*
+ * executed in bcnc->priv->wrapper's thread
+ */
static gpointer
wrapper_have_meta_store_ready (BrowserConnection *bcnc, GError **error)
{
@@ -589,11 +594,6 @@ wrapper_have_meta_store_ready (BrowserConnection *bcnc, GError **error)
}
g_slist_free (all);
#endif
- bcnc->priv->meta_store_signal =
- gda_thread_wrapper_connect_raw (bcnc->priv->wrapper, store, "meta-changed",
- FALSE, FALSE,
- (GdaThreadWrapperCallback) meta_changed_cb,
- bcnc);
g_object_unref (store);
return retval ? (void*) 0x01 : NULL;
}
@@ -685,6 +685,17 @@ browser_connection_set_property (GObject *object,
lerror->message ? lerror->message : _("No
detail"));
g_clear_error (&lerror);
}
+ else {
+ GdaMetaStore *store;
+ g_object_get (G_OBJECT (bcnc->priv->cnc), "meta-store", &store, NULL);
+ bcnc->priv->meta_store_signal =
+ gda_thread_wrapper_connect_raw (bcnc->priv->wrapper, store,
"meta-changed",
+ FALSE, FALSE,
+ (GdaThreadWrapperCallback)
meta_changed_cb,
+ bcnc);
+ g_object_unref (store);
+ }
+
}
break;
default:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]