mirror of
https://github.com/golang/go
synced 2024-11-21 17:14:45 -07:00
new
Change-Id: Iee83b60a107cc4a24fda9bf6e0c0fadacb1bec03
This commit is contained in:
parent
6acb9f1a47
commit
e0efaca829
@ -378,8 +378,8 @@ func parentCancelCtx(parent Context) (*cancelCtx, bool) {
|
||||
if !ok {
|
||||
return nil, false
|
||||
}
|
||||
pdone, _ := p.done.Load().(chan struct{})
|
||||
if pdone != done {
|
||||
pdone := p.done.Load()
|
||||
if pdone != nil && *pdone != done {
|
||||
return nil, false
|
||||
}
|
||||
return p, true
|
||||
@ -546,7 +546,7 @@ func (c *cancelCtx) cancel(removeFromParent bool, err, cause error) {
|
||||
c.err = err
|
||||
c.cause = cause
|
||||
d := c.done.Load()
|
||||
if *d == nil {
|
||||
if d == nil {
|
||||
c.done.Store(&closedchan)
|
||||
} else {
|
||||
close(*d)
|
||||
|
Loading…
Reference in New Issue
Block a user