Skip to content

Commit

Permalink
Backport initialization of mu in NewCtxClient to release-3.5
Browse files Browse the repository at this point in the history
Tested against the demo code provided in PR etcd-io#17001

References:
- etcd-io#17001
- etcd-io#17018

Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
  • Loading branch information
henrybear327 committed Apr 3, 2024
1 parent cbd0aed commit 61a85b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/v3/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func New(cfg Config) (*Client, error) {
// service interface implementations and do not need connection management.
func NewCtxClient(ctx context.Context, opts ...Option) *Client {
cctx, cancel := context.WithCancel(ctx)
c := &Client{ctx: cctx, cancel: cancel, lgMu: new(sync.RWMutex)}
c := &Client{ctx: cctx, cancel: cancel, lgMu: new(sync.RWMutex), mu: new(sync.RWMutex)}
for _, opt := range opts {
opt(c)
}
Expand Down

0 comments on commit 61a85b7

Please sign in to comment.