code: func (q *segmentQueue) dequeue() *segment {
  	q.mu.Lock()
  	s := q.list.Front()
  	if s != nil {
  		q.list.Remove(s)
  		q.used -= s.data.Size() + header.TCPMinimumSize
  	}
  	q.mu.Unlock()
  
  	return s
  }
docs: // dequeue removes and returns the next segment from queue, if one exists.
  // Ownership is transferred to the caller, who is responsible for decrementing
  // the ref count when done.