Initial commit

Initial public review release v0.10.0
This commit is contained in:
alexvanin 2020-07-10 17:17:51 +03:00 committed by Stanislav Bogatyrev
commit dadfd90dcd
276 changed files with 46331 additions and 0 deletions

View file

@ -0,0 +1,27 @@
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)} }