In the cancel method of timerCtx type:
func (c *timerCtx) cancel(removeFromParent bool, err error) {
c.cancelCtx.cancel(false, err)
if removeFromParent {
// Remove this timerCtx from its parent cancelCtx's children.
removeChild(c.cancelCtx.Context, c)
}
c.mu.Lock()
Thanks. I see.
在2021年4月27日星期二 UTC+8 上午5:50:09 写道:
> On Mon, Apr 26, 2021 at 9:59 AM qinggeer Bao wrote:
> >
> > if parentCancelCtx return false, it means no cancellable ancestors
> found, then why do we need run another goroutine to listen for parent's
> cancel sig
For learning purpose, I'm reading the source code of Golang standard
package: context.
Roughly understand the logics with one confusing point in
the propagateCancel below:
func propagateCancel(parent Context, child canceler) {
done := parent.Done()
if done == nil {
return // pare