apimachinery: k8s.io/apimachinery/pkg/util/waitgroup Index | Files

package waitgroup

import "k8s.io/apimachinery/pkg/util/waitgroup"

Package waitgroup implements SafeWaitGroup wrap of sync.WaitGroup. Add with positive delta when waiting will fail, to prevent sync.WaitGroup race issue.


Package Files

doc.go waitgroup.go

type SafeWaitGroup Uses

type SafeWaitGroup struct {
    // contains filtered or unexported fields

SafeWaitGroup must not be copied after first use.

func (*SafeWaitGroup) Add Uses

func (wg *SafeWaitGroup) Add(delta int) error

Add adds delta, which may be negative, similar to sync.WaitGroup. If Add with a positive delta happens after Wait, it will return error, which prevent unsafe Add.

func (*SafeWaitGroup) Done Uses

func (wg *SafeWaitGroup) Done()

Done decrements the WaitGroup counter.

func (*SafeWaitGroup) Wait Uses

func (wg *SafeWaitGroup) Wait()

Wait blocks until the WaitGroup counter is zero.

Package waitgroup imports 2 packages (graph) and is imported by 3 packages. Updated 2018-03-18. Refresh now. Tools for package owners.