agent/utils/sync/sequential_waitgroup.go
func (s *SequentialWaitGroup) Add(sequence int64, delta int) {
	s.mutex.Lock()
	defer s.mutex.Unlock()

	_, ok := s.semaphores[sequence]
	if ok {
		s.semaphores[sequence] += delta
	} else {
		s.semaphores[sequence] = delta
	}
	if s.semaphores[sequence] <= 0 {
		delete(s.semaphores, sequence)
		s.change.Broadcast()
	}
}
func (s *SequentialWaitGroup) Add(sequence int64, delta int) {
	s.mutex.Lock()
	defer s.mutex.Unlock()

	_, ok := s.semaphores[sequence]
	if ok {
		s.semaphores[sequence] += delta
	} else {
		s.semaphores[sequence] = delta
	}
	if s.semaphores[sequence] <= 0 {
		delete(s.semaphores, sequence)
		s.change.Broadcast()
	}
}
// Add adds the given delta to the waitgroup at the given sequence