fix continuous updating config with same key invalid bug

This commit is contained in:
liuwentan
2023-03-15 13:30:39 +08:00
parent 90d0764845
commit fc4ee32b6c
12 changed files with 287 additions and 398 deletions

View File

@@ -32,12 +32,16 @@ void rcu_hash_set_user_ctx(struct rcu_hash_table *htable, void *user_ctx);
void *rcu_hash_get_user_ctx(struct rcu_hash_table *htable);
/**
* @brief just means add to the updating nodes
* after call rcu_hash_commit, they become effective nodes
* @brief Adding the updating nodes which will become effective nodes after call rcu_hash_commit
*
* @retval 0(success) -1(failed)
*/
void rcu_hash_add(struct rcu_hash_table *htable, const char *key, size_t key_len, void *data);
int rcu_hash_add(struct rcu_hash_table *htable, const char *key, size_t key_len, void *data);
void rcu_hash_del(struct rcu_hash_table *htable, const char *key, size_t key_len);
/**
* @brief Deleting
*/
int rcu_hash_del(struct rcu_hash_table *htable, const char *key, size_t key_len);
/**
* @brief find in effective nodes
@@ -50,8 +54,6 @@ void rcu_hash_del(struct rcu_hash_table *htable, const char *key, size_t key_len
*/
void *rcu_hash_find(struct rcu_hash_table *htable, const char *key, size_t key_len);
void *rcu_hash_updating_find(struct rcu_hash_table *htable, const char *key, size_t key_len);
/**
* @brief list all effective nodes
*
@@ -73,8 +75,6 @@ int rcu_hash_is_updating(struct rcu_hash_table *htable);
*/
void rcu_hash_commit(struct rcu_hash_table *htable);
size_t rcu_hash_garbage_queue_len(struct rcu_hash_table *htable);
#ifdef __cplusplus
}
#endif