code: func (e *endpoint) Close() {
  	// Tell dispatch goroutine to stop, then write to the eventfd so that
  	// it wakes up in case it's sleeping.
  	atomic.StoreUint32(&e.stopRequested, 1)
  	syscall.Write(e.rx.eventFD, []byte{1, 0, 0, 0, 0, 0, 0, 0})
  
  	// Cleanup the queues inline if the worker hasn't started yet; we also
  	// know it won't start from now on because stopRequested is set to 1.
  	e.mu.Lock()
  	workerPresent := e.workerStarted
  	e.mu.Unlock()
  
  	if !workerPresent {
  		e.tx.cleanup()
  		e.rx.cleanup()
  	}
  }
docs: // Close frees all resources associated with the endpoint.