Commit 1b2279d6 authored by Akira TAGOH's avatar Akira TAGOH

thread-safe functions in fchash.c

parent 47581444
......@@ -169,13 +169,15 @@ FcHashTableAdd (FcHashTable *table,
return !ret;
for (prev = &table->buckets[hash % FC_HASH_SIZE];
(b = *prev); prev = &(b->next))
(b = fc_atomic_ptr_get (prev)); prev = &(b->next))
if (!table->compare_func (bucket->key, key))
goto destroy;
*prev = bucket;
if (!fc_atomic_ptr_cmpexch (prev, b, bucket))
goto retry;
return FcTrue;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment