Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
Semaphore is a counting semaphore.
func NewSemaphore ¶
NewSemaphore creates a new Semaphore with the given limit.
func (*Semaphore) Acquire ¶
func (l *Semaphore) Acquire()
Acquire acquires the semaphore. If the semaphore is already at its limit, it will block until one is released.
type WaitGroup ¶
type WaitGroup struct {
// contains filtered or unexported fields
}
WaitGroup is a synchronization primitive that waits for a collection of goroutines to finish. It is similar to sync.WaitGroup but with a context.
func NewWaitGroup ¶
NewWaitGroup creates a new WaitGroup instance.
func (*WaitGroup) Add ¶
Add adds delta, which may be negative, to the WaitGroup counter. If the counter becomes zero or less, the channel returned by Wait is closed.
Click to show internal directories.
Click to hide internal directories.