summaryrefslogtreecommitdiff
path: root/pango/pango-threadsafe.h
diff options
context:
space:
mode:
Diffstat (limited to 'pango/pango-threadsafe.h')
-rw-r--r--pango/pango-threadsafe.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/pango/pango-threadsafe.h b/pango/pango-threadsafe.h
index bc180746..cf8b4258 100644
--- a/pango/pango-threadsafe.h
+++ b/pango/pango-threadsafe.h
@@ -117,6 +117,20 @@ gpointer p_hash_table_lookup (PHashTable *hash_table,
}
static inline
+gpointer p_hash_table_lookup_ref (PHashTable *hash_table,
+ gconstpointer key,
+ gpointer (*ref_func) (gpointer))
+{
+ gpointer ret;
+ g_mutex_lock (&hash_table->mx);
+ ret = g_hash_table_lookup (hash_table->ht, key);
+ if (ret)
+ ref_func (ret);
+ g_mutex_unlock (&hash_table->mx);
+ return ret;
+}
+
+static inline
void p_hash_table_foreach (PHashTable *hash_table,
GHFunc func,
gpointer user_data)