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 {