sync

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InitBarrier

type InitBarrier chan struct{}

InitBarrier wraps around a channel to expose an interface to use the channel as an initialization barrier.

func NewInitBarrier

func NewInitBarrier() InitBarrier

NewInitBarrier creates a new populated initialization barrier which will allow a single thread to perform initialization.

func (InitBarrier) Failed

func (i InitBarrier) Failed()

Failed indicates that initialization failed in some way, another thread will be allowed to attempt initialization.

func (InitBarrier) Success

func (i InitBarrier) Success()

Success indicates that the initialization was a success, all threads blocking on 'Wait' will now be unblocked.

func (InitBarrier) Wait

func (i InitBarrier) Wait() bool

Wait will wait for access to whatever the initialization barrier is guarding, returns a boolean indicating whether the calling thread has exclusive access i.e. is the initializing thread.

Directories

Path Synopsis
Package hofp exposes a generic higher order function pool which abstracts aways the logic/error handling required to perform tasks concurrently by wrapping complex tasks into a common 'func(context.Context) error' interface.
Package hofp exposes a generic higher order function pool which abstracts aways the logic/error handling required to perform tasks concurrently by wrapping complex tasks into a common 'func(context.Context) error' interface.

Jump to

Keyboard shortcuts

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