semaphore

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 1 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
}

Semaphore is a semaphore implementation.

func NewSemaphore

func NewSemaphore(maxConcurrentOps uint) *Semaphore

NewSemaphore creates a new semaphore with the given limit.

func (*Semaphore) Acquire

func (s *Semaphore) Acquire()

Acquire acquires a semaphore.

func (*Semaphore) Count

func (s *Semaphore) Count() int

Count returns the number of acquired semaphores.

func (*Semaphore) Limit

func (s *Semaphore) Limit() int

Limit returns the limit of the semaphore.

func (*Semaphore) Release

func (s *Semaphore) Release()

Release releases a semaphore.

func (*Semaphore) Wait

func (s *Semaphore) Wait()

Wait waits for all acquired semaphores to be released.

Jump to

Keyboard shortcuts

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