code: func (p *process) SetTeardown(tf TeardownFunc) {
  	if tf == nil {
  		panic("cannot set nil TeardownFunc")
  	}
  
  	p.Lock()
  	if p.teardown != nil {
  		panic("cannot SetTeardown twice")
  	}
  
  	p.teardown = tf
  	select {
  	case <-p.Closed():
  		p.closeErr = tf()
  	default:
  	}
  	p.Unlock()
  }
docs: // SetTeardown to assign a teardown function