tendermint/common/async.go

16 lines
211 B
Go
Raw Normal View History

2015-10-21 12:15:19 -07:00
package common
import "sync"
func Parallel(tasks ...func()) {
var wg sync.WaitGroup
wg.Add(len(tasks))
for _, task := range tasks {
go func(task func()) {
task()
wg.Done()
}(task)
}
wg.Wait()
}