sync

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2016 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 1 Imported by: 0

Documentation

Overview

Package sync is an analogue to the stdlib sync package. It contains lowlevel synchonization primitives, but not quite as low level as 'sync' does

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SequentialWaitGroup

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

A SequentialWaitGroup waits for a collection of goroutines to finish. Each goroutine may add itself to the waitgroup with 'Add', providing a sequence number. Each goroutine should then call 'Done' with its sequence number when finished. Elsewhere, 'Wait' can be used to wait for all groups at or below the provided sequence number to complete.

func NewSequentialWaitGroup

func NewSequentialWaitGroup() *SequentialWaitGroup

func (*SequentialWaitGroup) Add

func (s *SequentialWaitGroup) Add(sequence int64, delta int)

Add adds the given delta to the waitgroup at the given sequence

func (*SequentialWaitGroup) Done

func (s *SequentialWaitGroup) Done(sequence int64)

Done decrements the waitgroup at the given sequence by one

func (*SequentialWaitGroup) Wait

func (s *SequentialWaitGroup) Wait(sequence int64)

Wait waits for all waitgroups at or below the given sequence to complete. Please note that this is *INCLUSIVE* of the sequence

Jump to

Keyboard shortcuts

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