|
@@ -8,5 +8,9 @@ var globalWaitGroup sync.WaitGroup
|
|
|
|
|
|
|
|
func GlobalWaitGroupWait() { globalWaitGroup.Wait() }
|
|
func GlobalWaitGroupWait() { globalWaitGroup.Wait() }
|
|
|
func GlobalWaitGroupWaitGo(f func()) {
|
|
func GlobalWaitGroupWaitGo(f func()) {
|
|
|
- globalWaitGroup.Go(f)
|
|
|
|
|
|
|
+ globalWaitGroup.Add(1)
|
|
|
|
|
+ go func() {
|
|
|
|
|
+ defer globalWaitGroup.Done()
|
|
|
|
|
+ f()
|
|
|
|
|
+ }()
|
|
|
}
|
|
}
|