src/shm/hashtable.h
@@ -7,13 +7,20 @@ #define MAPSIZE 1024 // 创建Queue数量的上限 #define QUEUE_COUNT_LIMIT 300 typedef struct hashtable_t { struct tailq_header_t* array[MAPSIZE]; int mutex; int queueCount; int currentKey; // 当前分配的key // int wlock; // int cond; // size_t readcnt; } hashtable_t; typedef void (*hashtable_foreach_cb)(int key, void *value); @@ -29,6 +36,8 @@ int hashtable_lock(hashtable_t *hashtable); int hashtable_unlock(hashtable_t *hashtable); int hashtable_get_queue_count(hashtable_t *hashtable) ; /** * 遍历hash_table * @demo