semaphore

package
v3.24.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Semaphore

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

func New

func New(n int) *Semaphore

func (*Semaphore) Acquire added in v3.21.0

func (s *Semaphore) Acquire(ctx context.Context) (*Token, bool)

func (*Semaphore) TryAcquire added in v3.21.0

func (s *Semaphore) TryAcquire() (*Token, bool)

type Token

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

func (*Token) Release

func (t *Token) Release()

Jump to

Keyboard shortcuts

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