From 804bc9822704417ac346cc97f133bce9d21b6175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Fri, 29 Dec 2023 11:21:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BB=E5=86=99=E9=94=81?= =?UTF-8?q?=E9=94=99=E4=BD=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common.go b/common.go index eb251f0..2d27e92 100644 --- a/common.go +++ b/common.go @@ -243,8 +243,8 @@ func (c *common) GetString(key interface{}) (string, error) { func (c *common) Set(key interface{}, value interface{}) { segmentIndex := util.Hash.GetHashIDMod(key, c.segment) - c.lock.Lock() - defer c.lock.RUnlock() + c.Lock() + defer c.Unlock() if c.dataTableType == normalDataTableType { c.normalDataTable[segmentIndex][key] = value } else {