semaphore

package
v4.36.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 0 Imported by: 3

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