mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-23 09:41:38 +00:00
move all files to common/ to begin repo merge
This commit is contained in:
15
common/async.go
Normal file
15
common/async.go
Normal file
@ -0,0 +1,15 @@
|
||||
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()
|
||||
}
|
Reference in New Issue
Block a user