semaphore

package
v4.7.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2018 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

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

Instance is an implementation of semaphore.

func New

func New(n int) *Instance

New create a new Semaphore with n permits.

func (*Instance) Signal

func (s *Instance) Signal()

Signal releases a permit into the semaphore.

func (*Instance) Wait

func (s *Instance) Wait() <-chan struct{}

Wait returns a channel for acquiring a permit.

Jump to

Keyboard shortcuts

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