We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 24a4da8 commit 4d53320Copy full SHA for 4d53320
1 file changed
libbeat/monitoring/namespace.go
@@ -23,6 +23,7 @@ var namespaces = NewNamespaces()
23
24
// Namespace contains the name of the namespace and it's registry
25
type Namespace struct {
26
+ sync.Mutex
27
name string
28
registry *Registry
29
}
@@ -42,11 +43,15 @@ func GetNamespace(name string) *Namespace {
42
43
44
// SetRegistry sets the registry of the namespace
45
func (n *Namespace) SetRegistry(r *Registry) {
46
+ n.Lock()
47
+ defer n.Unlock()
48
n.registry = r
49
50
51
// GetRegistry gets the registry of the namespace
52
func (n *Namespace) GetRegistry() *Registry {
53
54
55
if n.registry == nil {
56
n.registry = NewRegistry()
57
0 commit comments