semaphore

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 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 Semaphore

type Semaphore chan struct{}

Semaphore is empty type chan

func NewSemaphore

func NewSemaphore(N int) Semaphore

NewSemaphore return semaphore

func (Semaphore) Lock

func (s Semaphore) Lock()

Lock used to lock resource

func (Semaphore) P

func (s Semaphore) P(n int)

P used to acquire n resources

func (Semaphore) Signal

func (s Semaphore) Signal()

Signal used to send signal

func (Semaphore) Unlock

func (s Semaphore) Unlock()

Unlock used to unlock resource

func (Semaphore) V

func (s Semaphore) V(n int)

V used to release n resouces

func (Semaphore) Wait

func (s Semaphore) Wait(n int)

Wait used to wait signal

Jump to

Keyboard shortcuts

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