修复读写锁错位问题

This commit is contained in:
白茶清欢 2023-12-29 11:21:22 +08:00
parent 489e31b07a
commit 804bc98227
1 changed files with 2 additions and 2 deletions

View File

@ -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 {