sync

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 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 Once

type Once chan struct{}

func NewOnce

func NewOnce() Once

func (Once) Do

func (o Once) Do(f func())

type Semaphore

type Semaphore chan struct{}

func NewSemaphore

func NewSemaphore(size int) Semaphore

func (Semaphore) Lock

func (s Semaphore) Lock()

func (Semaphore) TryLock

func (s Semaphore) TryLock() bool

TryLock is like Lock, but it immediately returns whether it was able to lock or not without waiting.

func (Semaphore) Unlock

func (s Semaphore) Unlock()

Jump to

Keyboard shortcuts

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