semaphore

package
v0.0.0-...-b271b0b Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: MIT Imports: 0 Imported by: 66

Documentation

Overview

Package semaphore implements a channel-based semaphore.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Semaphore

type Semaphore chan struct{}

Semaphore channel.

func (Semaphore) Acquire

func (s Semaphore) Acquire()

Acquire resource.

func (Semaphore) Release

func (s Semaphore) Release()

Release resource.

func (Semaphore) Run

func (s Semaphore) Run(fn func())

Run `fn` in a goroutine, acquiring then releasing after its return.

func (Semaphore) Wait

func (s Semaphore) Wait()

Wait for completion.

Jump to

Keyboard shortcuts

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