mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-12 07:41:02 +00:00
convert some locks to rlocks
This commit is contained in:
parent
42032584b5
commit
55de0402d2
2 changed files with 5 additions and 6 deletions
4
frame.go
4
frame.go
|
|
@ -533,8 +533,8 @@ func (f *Frame) view(name string) *View { return f.views[name] }
|
|||
|
||||
// Views returns a list of all views in the frame.
|
||||
func (f *Frame) Views() []*View {
|
||||
f.mu.Lock()
|
||||
defer f.mu.Unlock()
|
||||
f.mu.RLock()
|
||||
defer f.mu.RUnlock()
|
||||
|
||||
other := make([]*View, 0, len(f.views))
|
||||
for _, view := range f.views {
|
||||
|
|
|
|||
|
|
@ -196,15 +196,14 @@ func (h *Holder) index(name string) *Index { return h.indexes[name] }
|
|||
|
||||
// Indexes returns a list of all indexes in the holder.
|
||||
func (h *Holder) Indexes() []*Index {
|
||||
h.mu.Lock()
|
||||
defer h.mu.Unlock()
|
||||
|
||||
h.mu.RLock()
|
||||
a := make([]*Index, 0, len(h.indexes))
|
||||
for _, index := range h.indexes {
|
||||
a = append(a, index)
|
||||
}
|
||||
sort.Sort(indexSlice(a))
|
||||
h.mu.RUnlock()
|
||||
|
||||
sort.Sort(indexSlice(a))
|
||||
return a
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue