code: func (s *Semaphore) DrainPermits() int {
  	n := s.AvailablePermits()
  	if n > 0 {
  		s.AcquireMany(n)
  	}
  	return n
  }
docs: // DrainPermits acquires all available permits and return the number of permits acquired.