X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=rculfhash.c;h=e5db86cf4ac37acbd9d93d42b2505d470a2c4749;hb=f651e9ad93bc07873780557016bad7209ad202fc;hp=bdf9fc000c4abe7b596c56eda705b3ca24ab041a;hpb=5bc6b66f4dd5e21dc30d647760530a3ce06f4c2f;p=urcu.git diff --git a/rculfhash.c b/rculfhash.c index bdf9fc0..e5db86c 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -739,7 +739,6 @@ void _cds_lfht_gc_bucket(struct cds_lfht_node *bucket, struct cds_lfht_node *nod new_next = clear_flag(next); (void) uatomic_cmpxchg(&iter_prev->next, iter, new_next); } - return; } static @@ -1124,13 +1123,15 @@ void remove_table_partition(struct cds_lfht *ht, unsigned long i, assert(i > MIN_TABLE_ORDER); ht->flavor->read_lock(); for (j = size + start; j < size + start + len; j++) { - struct cds_lfht_node *fini_node = bucket_at(ht, j); + struct cds_lfht_node *fini_bucket = bucket_at(ht, j); + struct cds_lfht_node *parent_bucket = bucket_at(ht, j - size); assert(j >= size && j < (size << 1)); dbg_printf("remove entry: order %lu index %lu hash %lu\n", i, j, j); - fini_node->reverse_hash = bit_reverse_ulong(j); - (void) _cds_lfht_del(ht, size, fini_node, 1); + /* Set the REMOVED_FLAG to freeze the ->next for gc */ + uatomic_or(&fini_bucket->next, REMOVED_FLAG); + _cds_lfht_gc_bucket(parent_bucket, fini_bucket); } ht->flavor->read_unlock(); }