mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 03:29:50 +00:00
tag: xmp: removing useless locking
Everything in the xmp helper lib is initiallized once and on a thread safe way, and after that there are only reads going on, no more writing. Based on that, drop the locking.
This commit is contained in:
parent
344df0b217
commit
0c51c8209b
1 changed files with 0 additions and 11 deletions
|
@ -95,10 +95,6 @@ typedef struct _PendingXmpTag PendingXmpTag;
|
||||||
* of each GSList in the mapping.
|
* of each GSList in the mapping.
|
||||||
*/
|
*/
|
||||||
static GHashTable *__xmp_tag_map;
|
static GHashTable *__xmp_tag_map;
|
||||||
static GMutex *__xmp_tag_map_mutex;
|
|
||||||
|
|
||||||
#define XMP_TAG_MAP_LOCK g_mutex_lock (__xmp_tag_map_mutex)
|
|
||||||
#define XMP_TAG_MAP_UNLOCK g_mutex_unlock (__xmp_tag_map_mutex)
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_xmp_tag_add_mapping (const gchar * gst_tag, GPtrArray * array)
|
_xmp_tag_add_mapping (const gchar * gst_tag, GPtrArray * array)
|
||||||
|
@ -108,11 +104,9 @@ _xmp_tag_add_mapping (const gchar * gst_tag, GPtrArray * array)
|
||||||
|
|
||||||
key = g_quark_from_string (gst_tag);
|
key = g_quark_from_string (gst_tag);
|
||||||
|
|
||||||
XMP_TAG_MAP_LOCK;
|
|
||||||
list = g_hash_table_lookup (__xmp_tag_map, GUINT_TO_POINTER (key));
|
list = g_hash_table_lookup (__xmp_tag_map, GUINT_TO_POINTER (key));
|
||||||
list = g_slist_append (list, (gpointer) array);
|
list = g_slist_append (list, (gpointer) array);
|
||||||
g_hash_table_insert (__xmp_tag_map, GUINT_TO_POINTER (key), list);
|
g_hash_table_insert (__xmp_tag_map, GUINT_TO_POINTER (key), list);
|
||||||
XMP_TAG_MAP_UNLOCK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -145,9 +139,7 @@ _xmp_tag_get_mapping (const gchar * gst_tag)
|
||||||
GSList *ret = NULL;
|
GSList *ret = NULL;
|
||||||
GQuark key = g_quark_from_string (gst_tag);
|
GQuark key = g_quark_from_string (gst_tag);
|
||||||
|
|
||||||
XMP_TAG_MAP_LOCK;
|
|
||||||
ret = (GSList *) g_hash_table_lookup (__xmp_tag_map, GUINT_TO_POINTER (key));
|
ret = (GSList *) g_hash_table_lookup (__xmp_tag_map, GUINT_TO_POINTER (key));
|
||||||
XMP_TAG_MAP_UNLOCK;
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -162,7 +154,6 @@ _xmp_tag_get_mapping_reverse (const gchar * xmp_tag, XmpTag ** _xmp_tag)
|
||||||
GSList *walk;
|
GSList *walk;
|
||||||
gint index;
|
gint index;
|
||||||
|
|
||||||
XMP_TAG_MAP_LOCK;
|
|
||||||
|
|
||||||
/* Iterate over the hashtable */
|
/* Iterate over the hashtable */
|
||||||
g_hash_table_iter_init (&iter, __xmp_tag_map);
|
g_hash_table_iter_init (&iter, __xmp_tag_map);
|
||||||
|
@ -187,7 +178,6 @@ _xmp_tag_get_mapping_reverse (const gchar * xmp_tag, XmpTag ** _xmp_tag)
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
XMP_TAG_MAP_UNLOCK;
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -711,7 +701,6 @@ _init_xmp_tag_map ()
|
||||||
GPtrArray *array;
|
GPtrArray *array;
|
||||||
XmpTag *xmpinfo;
|
XmpTag *xmpinfo;
|
||||||
|
|
||||||
__xmp_tag_map_mutex = g_mutex_new ();
|
|
||||||
__xmp_tag_map = g_hash_table_new (g_direct_hash, g_direct_equal);
|
__xmp_tag_map = g_hash_table_new (g_direct_hash, g_direct_equal);
|
||||||
|
|
||||||
/* add the maps */
|
/* add the maps */
|
||||||
|
|
Loading…
Reference in a new issue