[evolution-data-server/gnome-3-8] ESourceRegistry: object_path_table cleanups.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-8] ESourceRegistry: object_path_table cleanups.
- Date: Thu, 2 May 2013 12:56:24 +0000 (UTC)
commit 1d63cd3971097714acf26cac33466305b19afbe6
Author: Matthew Barnes <mbarnes redhat com>
Date: Tue Apr 30 13:52:19 2013 -0400
ESourceRegistry: object_path_table cleanups.
(cherry picked from commit 995aff9ca6760b5c0700b1250ea6064110864908)
libedataserver/e-source-registry.c | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/libedataserver/e-source-registry.c b/libedataserver/e-source-registry.c
index 4644826..a835de5 100644
--- a/libedataserver/e-source-registry.c
+++ b/libedataserver/e-source-registry.c
@@ -299,13 +299,17 @@ source_registry_object_path_table_insert (ESourceRegistry *registry,
const gchar *object_path,
ESource *source)
{
+ GHashTable *object_path_table;
+
g_return_if_fail (object_path != NULL);
g_return_if_fail (E_IS_SOURCE (source));
+ object_path_table = registry->priv->object_path_table;
+
g_mutex_lock (®istry->priv->object_path_table_lock);
g_hash_table_insert (
- registry->priv->object_path_table,
+ object_path_table,
g_strdup (object_path),
g_object_ref (source));
@@ -316,14 +320,16 @@ static ESource *
source_registry_object_path_table_lookup (ESourceRegistry *registry,
const gchar *object_path)
{
+ GHashTable *object_path_table;
ESource *source;
g_return_val_if_fail (object_path != NULL, NULL);
+ object_path_table = registry->priv->object_path_table;
+
g_mutex_lock (®istry->priv->object_path_table_lock);
- source = g_hash_table_lookup (
- registry->priv->object_path_table, object_path);
+ source = g_hash_table_lookup (object_path_table, object_path);
if (source != NULL)
g_object_ref (source);
@@ -336,14 +342,16 @@ static gboolean
source_registry_object_path_table_remove (ESourceRegistry *registry,
const gchar *object_path)
{
+ GHashTable *object_path_table;
gboolean removed;
g_return_val_if_fail (object_path != NULL, FALSE);
+ object_path_table = registry->priv->object_path_table;
+
g_mutex_lock (®istry->priv->object_path_table_lock);
- removed = g_hash_table_remove (
- registry->priv->object_path_table, object_path);
+ removed = g_hash_table_remove (object_path_table, object_path);
g_mutex_unlock (®istry->priv->object_path_table_lock);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]