Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2024-03-09 20:04:32 +03:00
parent a39a2f398a
commit e430c15ae8

View File

@ -57,8 +57,9 @@ func (g *WaitGroup) WaitContext(ctx context.Context) {
select {
case <-ctx.Done():
g.drain.Store(true)
g.wg.Add(-int(g.c.Load()))
<-done
g.drain.Store(false)
return
case <-done:
return