OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / tendermint / tmlibs / common / async.go
1 package common
2
3 import "sync"
4
5 func Parallel(tasks ...func()) {
6         var wg sync.WaitGroup
7         wg.Add(len(tasks))
8         for _, task := range tasks {
9                 go func(task func()) {
10                         task()
11                         wg.Done()
12                 }(task)
13         }
14         wg.Wait()
15 }