hole the rlock while reading WriteCell

This commit is contained in:
zhiqiangxu 2024-01-06 21:33:58 +08:00
parent aa00c8f96c
commit d0c7045cce

View file

@ -222,8 +222,8 @@ func (mv *MVHashMap) Read(k Key, txIdx int) (res MVReadResult) {
}
cells.rw.RLock()
fk, fv := cells.tm.Floor(txIdx - 1)
cells.rw.RUnlock()
if fk != nil && fv != nil {
c := fv.(*WriteCell)
@ -242,6 +242,8 @@ func (mv *MVHashMap) Read(k Key, txIdx int) (res MVReadResult) {
}
}
cells.rw.RUnlock()
return
}