X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=rculfhash.c;h=b8fbb6481d9291a6226f2200f8374b810ffd34af;hb=0b8ab7df078a6d8e1439b1db5849638892e1cc83;hp=e9cf0622f53576ef8ad8c08eda082c37f1151b86;hpb=71bb3aca70894bd78ec75f47c0c464261ad1dc86;p=urcu.git diff --git a/rculfhash.c b/rculfhash.c index e9cf062..b8fbb64 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -1073,6 +1073,11 @@ int _cds_lfht_del(struct cds_lfht *ht, unsigned long size, if (caa_unlikely(is_removed(next))) return -ENOENT; assert(!is_bucket(next)); + /* + * The del operation semantic guarantees a full memory barrier + * before the uatomic_or atomic commit of the deletion flag. + */ + cmm_smp_mb__before_uatomic_or(); /* * We set the REMOVED_FLAG unconditionally. Note that there may * be more than one concurrent thread setting this flag. @@ -1723,8 +1728,10 @@ int cds_lfht_destroy(struct cds_lfht *ht, pthread_attr_t **attr) /* Wait for in-flight resize operations to complete */ _CMM_STORE_SHARED(ht->in_progress_destroy, 1); cmm_smp_mb(); /* Store destroy before load resize */ + ht->flavor->thread_offline(); while (uatomic_read(&ht->in_progress_resize)) poll(NULL, 0, 100); /* wait for 100ms */ + ht->flavor->thread_online(); ret = cds_lfht_delete_bucket(ht); if (ret) return ret;