X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=src%2Frculfhash.c;fp=src%2Frculfhash.c;h=8046f3a63a280397be3986231f1db8921ea4bfdb;hp=04fd49946aa940184015a4921971feff5d3818e5;hb=4c10e9af6fb29192621372ab9077860f3c1b179f;hpb=6568fdbf5ce243f1ac4d167e8479f84e2ae008b6 diff --git a/src/rculfhash.c b/src/rculfhash.c index 04fd499..8046f3a 100644 --- a/src/rculfhash.c +++ b/src/rculfhash.c @@ -851,6 +851,12 @@ int is_removal_owner(struct cds_lfht_node *node) return ((unsigned long) node) & REMOVAL_OWNER_FLAG; } +static +struct cds_lfht_node *flag_removed(struct cds_lfht_node *node) +{ + return (struct cds_lfht_node *) (((unsigned long) node) | REMOVED_FLAG); +} + static struct cds_lfht_node *flag_removal_owner(struct cds_lfht_node *node) { @@ -1578,6 +1584,12 @@ const struct cds_lfht_mm_type *get_mm_type( } #endif +void cds_lfht_node_init_deleted(struct cds_lfht_node *node) +{ + cds_lfht_node_init(node); + node->next = flag_removed(NULL); +} + struct cds_lfht *_cds_lfht_new(unsigned long init_size, unsigned long min_nr_alloc_buckets, unsigned long max_nr_buckets,