| 69 | } |
| 70 | |
| 71 | type lazyBalancer struct { |
| 72 | // The following fields are initialized at build time and read-only after |
| 73 | // that and therefore do not need to be guarded by a mutex. |
| 74 | cc balancer.ClientConn |
| 75 | buildOptions balancer.BuildOptions |
| 76 | logger *internalgrpclog.PrefixLogger |
| 77 | childBuilder ChildBuilderFunc |
| 78 | |
| 79 | // The following fields are accessed while handling calls to the idlePicker |
| 80 | // and when handling ClientConn state updates. They are guarded by a mutex. |
| 81 | |
| 82 | mu sync.Mutex |
| 83 | delegate balancer.Balancer |
| 84 | latestClientConnState *balancer.ClientConnState |
| 85 | latestResolverError error |
| 86 | } |
| 87 | |
| 88 | func (lb *lazyBalancer) Close() { |
| 89 | lb.mu.Lock() |
nothing calls this directly
no outgoing calls
no test coverage detected