Skip to content

Commit

Permalink
storage/spanlatch: address minor PR comments
Browse files Browse the repository at this point in the history
cockroachdb#31997 (review)

Release note: None
  • Loading branch information
nvanbenschoten committed Dec 4, 2018
1 parent 60fa260 commit af852f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/storage/spanlatch/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func (m *Manager) insertLocked(lg *Guard) {
latches := lg.latches(s, a)
for i := range latches {
latch := &latches[i]
latch.id = m.nextID()
latch.id = m.nextIDLocked()
switch a {
case spanset.SpanReadOnly:
// Add reads to the readSet. They only need to enter
Expand All @@ -277,7 +277,7 @@ func (m *Manager) insertLocked(lg *Guard) {
}
}

func (m *Manager) nextID() uint64 {
func (m *Manager) nextIDLocked() uint64 {
m.idAlloc++
return m.idAlloc
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/spanlatch/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func TestLatchManager(t *testing.T) {
defer leaktest.AfterTest(t)()
var m Manager

// Try latch with no overlapping already-acquired lathes.
// Try latches with no overlapping already-acquired lathes.
lg1 := m.MustAcquire(spans("a", "", write), zeroTS)
m.Release(lg1)

Expand Down

0 comments on commit af852f9

Please sign in to comment.