sync

package
v0.0.0-...-517aab8 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mutex

type Mutex struct {
	sync.Mutex
}

A Mutex is a mutual exclusion lock.

Building with `deadlock` flag will use Mutex in mutex_deadlock.go instead of this to detect deadlocks.

type RWMutex

type RWMutex struct {
	sync.RWMutex
}

An RWMutex is a reader/writer mutual exclusion lock.

Building with `deadlock` flag will use RWMutex in mutex_deadlock.go instead of this to detect deadlocks.

type ResultNotifier

type ResultNotifier struct {
	// contains filtered or unexported fields
}

ResultNotifier can be used for a goroutine to notify others that a job is done and pass the error occurred or nil if no error.

It's based on `sync.Cond`.

func NewResultNotifier

func NewResultNotifier(l sync.Locker) *ResultNotifier

NewResultNotifier creates a ResultNotifier.

func (*ResultNotifier) Done

func (r *ResultNotifier) Done() chan error

Done returns a channel that can be waited on for the job to finish and to receive the error occurred or nil if no error.

func (*ResultNotifier) Finish

func (r *ResultNotifier) Finish(err error)

Finish notifies that the job is done with the error occurred or nil if no error.

Jump to

Keyboard shortcuts

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