From abbefc9e25464b6d7414fe8153b726a1e7beff11 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Fri, 22 Jul 2016 16:54:11 -0700 Subject: [PATCH] grpcproxy: define 'watchergroups' in pointer To avoid copying mutex lock values --- proxy/grpcproxy/watch.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/grpcproxy/watch.go b/proxy/grpcproxy/watch.go index c3f7761c3..573b23cfb 100644 --- a/proxy/grpcproxy/watch.go +++ b/proxy/grpcproxy/watch.go @@ -50,7 +50,7 @@ func (wp *watchProxy) Watch(stream pb.Watch_WatchServer) (err error) { sws := serverWatchStream{ c: wp.c, - groups: wp.wgs, + groups: &wp.wgs, id: wp.nextStreamID, gRPCStream: stream, @@ -71,7 +71,7 @@ type serverWatchStream struct { c *clientv3.Client mu sync.Mutex // make sure any access of groups and singles is atomic - groups watchergroups + groups *watchergroups singles map[int64]*watcherSingle gRPCStream pb.Watch_WatchServer