From d8e48790913af2e735d34de2c673374f21a2d3eb Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期五, 05 二月 2021 17:59:08 +0800
Subject: [PATCH] update
---
src/shm/hashtable.h | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/src/shm/hashtable.h b/src/shm/hashtable.h
index 036745c..c19e899 100755
--- a/src/shm/hashtable.h
+++ b/src/shm/hashtable.h
@@ -5,15 +5,22 @@
#include <functional>
#include <set>
-#define MAPSIZE 100
+#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; // 褰撳墠鍒嗛厤鐨刱ey
// 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
--
Gitblit v1.8.0