syncutil

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package syncutil holds synchronization helpers the standard library lacks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WaitGroup

type WaitGroup struct {
	// contains filtered or unexported fields
}

WaitGroup counts goroutines like sync.WaitGroup, but Wait gives up once its context ends, and Add may come at any time, even while a Wait that gave up has left its count going.

func (*WaitGroup) Add

func (g *WaitGroup) Add(delta int)

func (*WaitGroup) Done

func (g *WaitGroup) Done()

func (*WaitGroup) Go

func (g *WaitGroup) Go(f func())

Go runs f in a goroutine the group counts.

func (*WaitGroup) Wait

func (g *WaitGroup) Wait(ctx context.Context) error

Wait returns nil once the count drops to zero, or ctx's error if ctx ends first.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL