finish
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
5df9e59f28
commit
1759bec5a9
@ -7,9 +7,9 @@ import (
|
||||
)
|
||||
|
||||
type WaitGroup struct {
|
||||
mu sync.Mutex
|
||||
wg *sync.WaitGroup
|
||||
c *atomic.Int64
|
||||
mu sync.Mutex
|
||||
}
|
||||
|
||||
func WrapWaitGroup(wg *sync.WaitGroup) *WaitGroup {
|
||||
@ -22,11 +22,7 @@ func WrapWaitGroup(wg *sync.WaitGroup) *WaitGroup {
|
||||
|
||||
func NewWaitGroup() *WaitGroup {
|
||||
var wg sync.WaitGroup
|
||||
g := &WaitGroup{
|
||||
wg: &wg,
|
||||
c: &(atomic.Int64{}),
|
||||
}
|
||||
return g
|
||||
return WrapWaitGroup(&wg)
|
||||
}
|
||||
|
||||
func (g *WaitGroup) Add(n int) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user