Thanks. I see. 在2021年4月27日星期二 UTC+8 上午5:50:09<Ian Lance Taylor> 写道:
> On Mon, Apr 26, 2021 at 9:59 AM qinggeer Bao <bao...@gmail.com> 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 signals? How it can happen in what kind of cases? > > See the documentation of parentCancelCtx: "If not, the *cancelCtx has > been wrapped in a custom implementation providing a different done > channel, in which case we should not bypass it." In other words, > people can and do provide their own custom implementations of the > context.Context interface. For those implementations, parentCancelCtx > will return nil, but that doesn't mean that the custom implementation > can't be cancelled. propagateCancel has to handle that case > correctly. See also XTestWithCancel and > XTestWithCancelCanceledParent. > > Ian > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/6d8bc5a7-44da-4144-8d59-ea8640d3ccd6n%40googlegroups.com.