This reverts commit
964f0c7a306998256f1c5a5fd78fc457a972f001.
Reason: cause increasing timeout in crypto/tls tests on race builders.
Change-Id: Id16d4fcd19c2ca2e89ad4d0c9d55ef1105b19c76
Reviewed-on: https://go-review.googlesource.com/c/go/+/422035
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
if d != nil {
return d.(chan struct{})
}
- c.done.CompareAndSwap(nil, make(chan struct{}))
- return c.done.Load().(chan struct{})
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ d = c.done.Load()
+ if d == nil {
+ d = make(chan struct{})
+ c.done.Store(d)
+ }
+ return d.(chan struct{})
}
func (c *cancelCtx) Err() error {