sync.Mutex
or sync.RWMutex
methods exposed GO-W401311
12// ValidatorMapHandler is a container to hold the map and a reference tracker for how many
13// states shared this.
14type ValidatorMapHandler struct {15 valIdxMap map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex
16 mapRef *Reference
17 *sync.RWMutex
7 "github.com/prysmaticlabs/prysm/v5/api/client/beacon/iface"
8)
9
10type NodeHealthTracker struct {11 isHealthy *bool
12 healthChan chan bool
13 node iface.HealthNode
12 Index primitives.ValidatorIndex
13}
14
15type TrackedValidatorsCache struct {16 sync.Mutex
17 trackedValidators map[primitives.ValidatorIndex]TrackedValidator
18}
59
60// InitializerWaiter provides an Initializer once all dependent resources are ready
61// via the WaitForInitializer method.
62type InitializerWaiter struct { 63 sync.RWMutex
64 ready bool
65 cw startup.ClockWaiter
Exposing sync.Mutex
or sync.RWMutex
allows the caller to Lock
or Unlock
the underlying mutex, potentially leading to a deadlock.
package main
import (
"sync"
)
type Foo struct {
sync.Mutex
A int
}
package main
import (
"sync"
)
type Foo struct {
A int
lock sync.Mutex
}