From 73689afc09ce346f9eb00e02faf7f242e55dc7ee Mon Sep 17 00:00:00 2001 From: fujuntang <fujuntang@smartai.com> Date: 星期四, 09 十二月 2021 19:33:00 +0800 Subject: [PATCH] Add the sync to fix the resource clear issue. --- src/shm/hashtable.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shm/hashtable.cpp b/src/shm/hashtable.cpp index 7162118..ab07ad1 100755 --- a/src/shm/hashtable.cpp +++ b/src/shm/hashtable.cpp @@ -53,7 +53,7 @@ TAILQ_FOREACH(item, my_tailq_head, joint) { - if ((check_mm_valid(item) == true) && (key == item->key)) + if ((check_mm_valid(item) == true) && ((key == item->key) || (code == item->key))) return item->value; break; @@ -321,7 +321,7 @@ if (key < MAPSIZE) { val = key; } else { - val = key % MAPSIZE + START_KEY; + val = key % MAPSIZE % (MAPSIZE - START_KEY) + START_KEY; } return val; -- Gitblit v1.8.0