Skip to content

Commit 4e84a63

Browse files
committed
fix Mutex review issue
Signed-off-by: seeflood <[email protected]>
1 parent a8e4b14 commit 4e84a63

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/grpc/lifecycle/grpc_api.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func checkDynamicComponent(kind string, name string, store interface{}, componen
8383
name: name,
8484
}] = &dynamicComponentHolder{
8585
DynamicComponent: comp,
86-
Mutex: sync.Mutex{},
86+
mu: sync.Mutex{},
8787
}
8888
}
8989

@@ -100,7 +100,7 @@ type componentKey struct {
100100

101101
type dynamicComponentHolder struct {
102102
common.DynamicComponent
103-
sync.Mutex
103+
mu sync.Mutex
104104
}
105105

106106
func (s *server) ApplyConfiguration(ctx context.Context, in *runtimev1pb.DynamicConfiguration) (*runtimev1pb.ApplyConfigurationResponse, error) {
@@ -135,8 +135,8 @@ func (s *server) ApplyConfiguration(ctx context.Context, in *runtimev1pb.Dynamic
135135
}
136136

137137
// 3. lock
138-
holder.Lock()
139-
defer holder.Unlock()
138+
holder.mu.Lock()
139+
defer holder.mu.Unlock()
140140

141141
// 4. delegate to components
142142
err := holder.ApplyConfig(ctx, in.GetComponentConfig().Metadata)

0 commit comments

Comments
 (0)