latch

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// Done returns a chan that blocks until Close is called. It never returns data.
	Done() <-chan struct{}
	// Close closes the latch; all future calls to Closed return true. Safe to invoke multiple times.
	Close()
	// Closed returns false while the latch is "open" and true after it has been closed via Close.
	Closed() bool
}

Interface funcs are safe to invoke concurrently.

func New

func New() Interface

New returns a new "open" latch such that Closed returns false until Close is invoked.

type L

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

func (*L) Close

func (l *L) Close()

Close may panic for an uninitialized L

func (*L) Closed

func (l *L) Closed() (result bool)

func (*L) Done

func (l *L) Done() <-chan struct{}

func (*L) Reset

func (l *L) Reset() *L

Reset clears the state of the latch, not safe to execute concurrently with other L methods.

Jump to

Keyboard shortcuts

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