X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fset%2Fgnunet-service-set.h;h=bc3052f02ed6dda644a72018df3ead84afb495cc;hb=4dcb414e2faabc800577c25dec3b63e3ceaaa84b;hp=d23291c828f922886798e0c46225216425c7eae3;hpb=7936cab9bd741a9ff30362c8495daa29f1874b2e;p=oweals%2Fgnunet.git diff --git a/src/set/gnunet-service-set.h b/src/set/gnunet-service-set.h index d23291c82..bc3052f02 100644 --- a/src/set/gnunet-service-set.h +++ b/src/set/gnunet-service-set.h @@ -323,6 +323,9 @@ struct ElementEntry */ struct MutationEvent *mutations; + /** + * Number of elements in the array @a mutations. + */ unsigned int mutations_size; /** @@ -437,6 +440,25 @@ struct SetContent struct GNUNET_CONTAINER_MultiHashMap *elements; unsigned int latest_generation; + + /** + * Mutations requested by the client that we're + * unable to execute right now because we're iterating + * over the underlying hash map of elements. + */ + struct PendingMutation *pending_mutations_head; + + /** + * Mutations requested by the client that we're + * unable to execute right now because we're iterating + * over the underlying hash map of elements. + */ + struct PendingMutation *pending_mutations_tail; + + /** + * Number of concurrently active iterators. + */ + int iterator_count; }; @@ -454,6 +476,22 @@ struct GenerationRange }; +struct PendingMutation +{ + struct PendingMutation *prev; + struct PendingMutation *next; + + struct Set *set; + + /** + * Message that describes the desired mutation. + * May only be a GNUNET_MESSAGE_TYPE_SET_ADD or + * GNUNET_MESSAGE_TYPE_SET_REMOVE. + */ + struct GNUNET_MessageHeader *mutation_message; +}; + + /** * A set that supports a specific operation with other peers. */ @@ -522,6 +560,9 @@ struct Set */ struct GenerationRange *excluded_generations; + /** + * Number of elements in array @a excluded_generations. + */ unsigned int excluded_generations_size; /** @@ -535,12 +576,16 @@ struct Set */ uint16_t iteration_id; + /** + * Generation we're currently iteration over. + */ + unsigned int iter_generation; + /** * Content, possibly shared by multiple sets, * and thus reference counted. */ struct SetContent *content; - };