frostfs-node/lib/replication/garbage.go
alexvanin dadfd90dcd Initial commit
Initial public review release v0.10.0
2020-07-10 17:45:00 +03:00

27 lines
384 B
Go

package replication
import (
"sync"
)
type (
garbageStore struct {
*sync.RWMutex
items []Address
}
)
func (s *garbageStore) put(addr Address) {
s.Lock()
defer s.Unlock()
for i := range s.items {
if s.items[i].Equal(&addr) {
return
}
}
s.items = append(s.items, addr)
}
func newGarbageStore() *garbageStore { return &garbageStore{RWMutex: new(sync.RWMutex)} }