Home | History | Annotate | Download | only in context

Lines Matching defs:Done

63 	// Deadline returns the time when work done on behalf of this context
68 // Done returns a channel that's closed when work done on behalf of this
69 // context should be canceled. Done may return nil if this context can
70 // never be canceled. Successive calls to Done return the same value.
72 // WithCancel arranges for Done to be closed when cancel is called;
73 // WithDeadline arranges for Done to be closed when the deadline
74 // expires; WithTimeout arranges for Done to be closed when the timeout
77 // Done is provided for use in select statements:
80 // // until DoSomething returns an error or ctx.Done is closed.
88 // case <-ctx.Done():
96 // a Done channel for cancelation.
97 Done() <-chan struct{}
99 // If Done is not yet closed, Err returns nil.
100 // If Done is closed, Err returns a non-nil error explaining why:
175 func (*emptyCtx) Done() <-chan struct{} {
224 // WithCancel returns a copy of parent with a new Done channel. The returned
225 // context's Done channel is closed when the returned cancel function is called
226 // or when the parent context's Done channel is closed, whichever happens first.
243 if parent.Done() == nil {
261 case <-parent.Done():
263 case <-child.Done():
304 Done() <-chan struct{}
320 done chan struct{} // created lazily, closed by first cancel call
325 func (c *cancelCtx) Done() <-chan struct{} {
327 if c.done == nil {
328 c.done = make(chan struct{})
330 d := c.done
345 // cancel closes c.done, cancels each of c's children, and, if
357 if c.done == nil {
358 c.done = closedchan
360 close(c.done)
377 // context's Done channel is closed when the deadline expires, when the returned
378 // cancel function is called, or when the parent context's Done channel is
409 // implement Done and Err. It implements cancel by stopping its timer then