// Done cleans up all resources.
547104
func (l *LocalFile) Done() {
	l.Close()
	if l.unlink {
		os.Remove(l.Name())
	}
}
763299
func (r *reader) Done(err error) {
	q := readerReport{
		t:    time.Now(),
		pos:  r.pos,
		size: r.size,
		bps:  &r.bps,
		err:  err,
	}

	select {
	case r.ch <- q:
		close(r.ch)
	case <-r.ctx.Done():
	}
}
862527
func (i *inflight) done(keys []jose.JSONWebKey, err error) {
	i.keys = keys
	i.err = err
	close(i.doneCh)
}
1021431
func (s *DurationRatioStat) Done(k interface{}) {
	s.m.Lock()
	defer s.m.Unlock()
	if !s.isStarted {
		return
	}
	s.d += time.Now().Sub(s.startedAt[k])
	delete(s.startedAt, k)
}
1099935
func (op *DestroyRelationOperation) Done(err error) error {
	if err != nil {
		if !op.Force {
			return errors.Annotatef(err, "cannot destroy relation %q", op.r)
		}
		op.AddError(errors.Errorf("forcefully destroying relation %v proceeded despite encountering ERROR %v", op.r, err))
	}
	return nil
}
1290882
func (w *TimeWait) Done() {
	hits := atomic.LoadInt64(&w.hits)

	if hits < 0 {
		return
	}

	newhit := atomic.AddInt64(&w.hits, -1)
	if int(newhit) <= 0 {
		w.Flush()
	}
}
1243794
func (p *Pool) Done() {
	p.mutex.Lock()
	defer p.mutex.Unlock()
	p.wg.Done()
	p.counter--
}
47004
func (w *Wrapped) done(err error) {
	w.once.Do(w.init)
	w.cancelLock.Lock()

	// Set the result
	w.resultErr = err
	w.resultSet = true

	// Notify any waiters
	w.cancelCond.Broadcast()

	// Unlock since the next call can be blocking
	w.cancelLock.Unlock()

	// Notify any channel listeners
	w.errCh <- err
}
847183
func (s *RPCServer) done() {
	s.lock.Lock()
	defer s.lock.Unlock()

	if s.DoneCh != nil {
		close(s.DoneCh)
		s.DoneCh = nil
	}
}
115266
func (o *Organizer) Cleanup(f func()) {
	o.cleanup = append(o.cleanup, f)
}
1189690
func (m *MultiSelect) Cleanup(val interface{}) error {
	// execute the output summary template with the answer
	return m.Render(
		MultiSelectQuestionTemplate,
		MultiSelectTemplateData{
			MultiSelect:   *m,
			SelectedIndex: m.selectedIndex,
			Checked:       m.checked,
			Answer:        strings.Join(val.([]string), ", "),
			ShowAnswer:    true,
		},
	)
}
1331673
func cleanup(ctx context.Context, client *containerd.Client) error {
	containers, err := client.Containers(ctx)
	if err != nil {
		return err
	}
	for _, c := range containers {
		task, err := c.Task(ctx, nil)
		if err == nil {
			task.Delete(ctx, containerd.WithProcessKill)
		}
		if err := c.Delete(ctx, containerd.WithSnapshotCleanup); err != nil {
			if derr := c.Delete(ctx); derr == nil {
				continue
			}
			return err
		}
	}
	return nil
}
442225
func (twg *TimeoutWaitGroup) Done() {
	twg.mutex.Lock()
	defer twg.mutex.Unlock()
	twg.workers--
	if twg.workers < 0 {
		panic("TimeoutWaitGroup: negative counter")
	}
	if twg.workers == 0 && twg.last != nil {
		close(twg.last)
	}
}
833548
func (q *Type) Done(item interface{}) {
	q.cond.L.Lock()
	defer q.cond.L.Unlock()
	q.processing.delete(item)
	if q.dirty.has(item) {
		q.queue = append(q.queue, item)
		q.cond.Signal()
	}
}
905936
func (l *FreeLooper) Done(err error) {
	if l.DoneChan != nil {
		l.DoneChan <- err
	}
}
1348792
func (ctx *AssertContext) Cleanup() {
	os.Remove(ctx.ConfigPath)
	os.Remove(ctx.ContentFile)

	if ctx.serviceAccountPath != "" {
		os.Remove(ctx.serviceAccountPath)
	}
	os.Unsetenv(GoogleAppCredentialsEnv)
}
342831
func (mi *MountInterrupter) Done() error {
	mi.Lock()
	defer mi.Unlock()
	if mi.fun != nil {
		err := mi.fun()
		if err != nil {
			mi.log.Errorf("Mount interrupter callback failed: %v", err)
			return err
		}
	}
	mi.once.Do(func() {
		close(mi.done)
	})
	return nil
}