X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=rcuja%2Frcuja-internal.h;h=1a3346bbbe96aa4b0ae44896bf51ad476404481f;hb=03ec1aebe1d8eaa2b03a12b501e5b988efc0a6d0;hp=9b1daca61cb7541009f8db64b9014215a5ff1fe4;hpb=4b677847e8454cc75399bef6d380eb9df38ee3f9;p=userspace-rcu.git diff --git a/rcuja/rcuja-internal.h b/rcuja/rcuja-internal.h index 9b1daca..1a3346b 100644 --- a/rcuja/rcuja-internal.h +++ b/rcuja/rcuja-internal.h @@ -190,6 +190,22 @@ int rcuja_delete_ht(struct cds_lfht *ht); __attribute__((visibility("protected"))) void free_cds_ja_node(struct cds_ja *ja, struct cds_ja_inode *node); +/* + * Iterate through duplicates returned by cds_ja_lookup*() + * Receives a struct cds_ja_node * as parameter, which is used as start + * of duplicate list and loop cursor. + */ +#define cds_ja_for_each_duplicate(pos) \ + for (; (pos) != NULL; (pos) = (pos)->next) + +/* + * Iterate through duplicates returned by cds_ja_lookup*() + * Safe against removal of entries during traversal. + */ +#define cds_ja_for_each_duplicate_safe(_pos, _next) \ + for (; (_pos) != NULL ? ((_next) = (_pos)->next, 1) : 0; \ + (_pos) = (_next)) + //#define DEBUG #ifdef __linux__