Add Inner Ring code

This commit is contained in:
Stanislav Bogatyrev 2020-07-24 16:54:03 +03:00
parent dadfd90dcd
commit b7b5079934
400 changed files with 11420 additions and 8690 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)} }