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 {
|
type WaitGroup struct {
|
||||||
mu sync.Mutex
|
|
||||||
wg *sync.WaitGroup
|
wg *sync.WaitGroup
|
||||||
c *atomic.Int64
|
c *atomic.Int64
|
||||||
|
mu sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
func WrapWaitGroup(wg *sync.WaitGroup) *WaitGroup {
|
func WrapWaitGroup(wg *sync.WaitGroup) *WaitGroup {
|
||||||
@ -22,11 +22,7 @@ func WrapWaitGroup(wg *sync.WaitGroup) *WaitGroup {
|
|||||||
|
|
||||||
func NewWaitGroup() *WaitGroup {
|
func NewWaitGroup() *WaitGroup {
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
g := &WaitGroup{
|
return WrapWaitGroup(&wg)
|
||||||
wg: &wg,
|
|
||||||
c: &(atomic.Int64{}),
|
|
||||||
}
|
|
||||||
return g
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *WaitGroup) Add(n int) {
|
func (g *WaitGroup) Add(n int) {
|
||||||
|
Loading…
Reference in New Issue
Block a user