github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library@v0.2.0/ConcurrentCall/externs.go (about)

     1  package ConcurrentCall
     2  
     3  import "sync"
     4  
     5  func ConcurrentCall(callee Callee, serialIters uint32, concurrentIters uint32) {
     6  	var wg sync.WaitGroup
     7  	for i := uint32(0); i < concurrentIters; i++ {
     8  		wg.Add(1)
     9  		concurrentPos := i
    10  		go func() {
    11  			defer wg.Done()
    12  			for j := uint32(0); j < serialIters; j++ {
    13  				callee.Call(j, concurrentPos)
    14  			}
    15  		}()
    16  		wg.Wait()
    17  	}
    18  }