semaphore

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: MPL-2.0 Imports: 0 Imported by: 19

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