deadlock

package
v0.0.0-...-d3cbdd1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeadSignal

type DeadSignal struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Simple orchestrator to close long running tasks and wait for them to acknowledge completion.

func (*DeadSignal) Close

func (ds *DeadSignal) Close(t string)

Close closes the dead channel and waits for other goroutines waiting on Dead() to call Done(). When Close returns, it is designed that any goroutines will no longer be using it.

func (*DeadSignal) Dead

func (ds *DeadSignal) Dead() chan bool

Returns the dead channel.

func (*DeadSignal) Done

func (ds *DeadSignal) Done()

Signifies the goroutine is done.

func (*DeadSignal) Kill

func (ds *DeadSignal) Kill()

Similar to Close however does not wait for goroutines to finish. Both should not be ran.

func (*DeadSignal) Revive

func (ds *DeadSignal) Revive()

Revive makes a closed DeadSignal create a new dead channel to allow for it to be reused. You should not revive on a closed channel if it is still being actively used.

func (*DeadSignal) Started

func (ds *DeadSignal) Started()

Signifies the goroutine has started. When calling open, done should be called on end.

Jump to

Keyboard shortcuts

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