finish
All checks were successful
pr / test (pull_request) Successful in 2m16s
lint / lint (pull_request) Successful in 10m44s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2024-03-09 22:55:42 +03:00
parent 5df9e59f28
commit 1759bec5a9

View File

@ -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) {