|
@@ -7,11 +7,11 @@ import (
|
|
"slices"
|
|
"slices"
|
|
"sort"
|
|
"sort"
|
|
"strconv"
|
|
"strconv"
|
|
- "sync"
|
|
|
|
"sync/atomic"
|
|
"sync/atomic"
|
|
"time"
|
|
"time"
|
|
|
|
|
|
"github.com/sirupsen/logrus"
|
|
"github.com/sirupsen/logrus"
|
|
|
|
+ "github.com/wadey/synctrace"
|
|
)
|
|
)
|
|
|
|
|
|
// forEachFunc is used to benefit folks that want to do work inside the lock
|
|
// forEachFunc is used to benefit folks that want to do work inside the lock
|
|
@@ -185,7 +185,7 @@ func (hr *hostnamesResults) GetAddrs() []netip.AddrPort {
|
|
// It serves as a local cache of query replies, host update notifications, and locally learned addresses
|
|
// It serves as a local cache of query replies, host update notifications, and locally learned addresses
|
|
type RemoteList struct {
|
|
type RemoteList struct {
|
|
// Every interaction with internals requires a lock!
|
|
// Every interaction with internals requires a lock!
|
|
- sync.RWMutex
|
|
|
|
|
|
+ synctrace.RWMutex
|
|
|
|
|
|
// The full list of vpn addresses assigned to this host
|
|
// The full list of vpn addresses assigned to this host
|
|
vpnAddrs []netip.Addr
|
|
vpnAddrs []netip.Addr
|
|
@@ -215,6 +215,7 @@ type RemoteList struct {
|
|
// NewRemoteList creates a new empty RemoteList
|
|
// NewRemoteList creates a new empty RemoteList
|
|
func NewRemoteList(vpnAddrs []netip.Addr, shouldAdd func(netip.Addr) bool) *RemoteList {
|
|
func NewRemoteList(vpnAddrs []netip.Addr, shouldAdd func(netip.Addr) bool) *RemoteList {
|
|
r := &RemoteList{
|
|
r := &RemoteList{
|
|
|
|
+ RWMutex: synctrace.NewRWMutex("remote-list"),
|
|
vpnAddrs: make([]netip.Addr, len(vpnAddrs)),
|
|
vpnAddrs: make([]netip.Addr, len(vpnAddrs)),
|
|
addrs: make([]netip.AddrPort, 0),
|
|
addrs: make([]netip.AddrPort, 0),
|
|
relays: make([]netip.Addr, 0),
|
|
relays: make([]netip.Addr, 0),
|