Skip to content

Commit

Permalink
hole the rlock while reading WriteCell
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiangxu authored and pratikspatil024 committed Jan 22, 2024
1 parent 0fb56ff commit 76db8bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/blockstm/mvhashmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -242,6 +242,8 @@ func (mv *MVHashMap) Read(k Key, txIdx int) (res MVReadResult) {
}
}

cells.rw.RUnlock()

return
}

Expand Down

0 comments on commit 76db8bb

Please sign in to comment.