修复读写锁错位问题
This commit is contained in:
parent
489e31b07a
commit
804bc98227
@ -243,8 +243,8 @@ func (c *common) GetString(key interface{}) (string, error) {
|
|||||||
|
|
||||||
func (c *common) Set(key interface{}, value interface{}) {
|
func (c *common) Set(key interface{}, value interface{}) {
|
||||||
segmentIndex := util.Hash.GetHashIDMod(key, c.segment)
|
segmentIndex := util.Hash.GetHashIDMod(key, c.segment)
|
||||||
c.lock.Lock()
|
c.Lock()
|
||||||
defer c.lock.RUnlock()
|
defer c.Unlock()
|
||||||
if c.dataTableType == normalDataTableType {
|
if c.dataTableType == normalDataTableType {
|
||||||
c.normalDataTable[segmentIndex][key] = value
|
c.normalDataTable[segmentIndex][key] = value
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user