X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu%2Frculfhash.h;h=6f09ddbde7cbe25f2afd83c85652c3609512f784;hb=22731b1993177a83bf5fbefde65c949df9c0ed22;hp=2938e5ec6235883acc9efb9b029e135035f7a10e;hpb=7b783f818175cd92d98f78e761331f306ff406a5;p=userspace-rcu.git diff --git a/urcu/rculfhash.h b/urcu/rculfhash.h index 2938e5e..6f09ddb 100644 --- a/urcu/rculfhash.h +++ b/urcu/rculfhash.h @@ -132,7 +132,8 @@ struct cds_lfht *_cds_lfht_new(unsigned long init_size, * @min_nr_alloc_buckets: the minimum number of allocated buckets. * (must be power of two) * @max_nr_buckets: the maximum number of hash table buckets allowed. - * (must be power of two) + * (must be power of two, 0 is accepted, means + * "infinite") * @flags: hash table creation flags (can be combined with bitwise or: '|'). * 0: no flags. * CDS_LFHT_AUTO_RESIZE: automatically resize hash table. @@ -175,6 +176,12 @@ struct cds_lfht *cds_lfht_new(unsigned long init_size, * * Return 0 on success, negative error value on error. * Threads calling this API need to be registered RCU read-side threads. + * cds_lfht_destroy should *not* be called from a RCU read-side critical + * section. It should *not* be called from call_rcu thread context + * neither. + * In userspace RCU 0.7.x, for QSBR RCU flavor, cds_lfht_destroy() has a + * side-effect: it puts the caller thread in "online" state. This will + * be fixed in userspace RCU 0.8.x. */ int cds_lfht_destroy(struct cds_lfht *ht, pthread_attr_t **attr); @@ -424,6 +431,11 @@ int cds_lfht_is_node_deleted(struct cds_lfht_node *node); * * Threads calling this API need to be registered RCU read-side threads. * This function does not (necessarily) issue memory barriers. + * cds_lfht_resize should *not* be called from a RCU read-side critical + * section. + * In userspace RCU 0.7.x, for QSBR RCU flavor, cds_lfht_resize() has a + * side-effect: it puts the caller thread in "online" state. This will + * be fixed in userspace RCU 0.8.x. */ void cds_lfht_resize(struct cds_lfht *ht, unsigned long new_size); @@ -450,21 +462,21 @@ void cds_lfht_resize(struct cds_lfht *ht, unsigned long new_size); #define cds_lfht_for_each_entry(ht, iter, pos, member) \ for (cds_lfht_first(ht, iter), \ pos = caa_container_of(cds_lfht_iter_get_node(iter), \ - typeof(*(pos)), member); \ + __typeof__(*(pos)), member); \ &(pos)->member != NULL; \ cds_lfht_next(ht, iter), \ pos = caa_container_of(cds_lfht_iter_get_node(iter), \ - typeof(*(pos)), member)) + __typeof__(*(pos)), member)) #define cds_lfht_for_each_entry_duplicate(ht, hash, match, key, \ iter, pos, member) \ for (cds_lfht_lookup(ht, hash, match, key, iter), \ pos = caa_container_of(cds_lfht_iter_get_node(iter), \ - typeof(*(pos)), member); \ + __typeof__(*(pos)), member); \ &(pos)->member != NULL; \ cds_lfht_next_duplicate(ht, match, key, iter), \ pos = caa_container_of(cds_lfht_iter_get_node(iter), \ - typeof(*(pos)), member)) + __typeof__(*(pos)), member)) #ifdef __cplusplus }