sync

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: MPL-2.0 Imports: 11 Imported by: 43

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mutex

type Mutex interface {
	Lock()
	Unlock()
}

func NewMutex

func NewMutex() Mutex

type RWMutex

type RWMutex interface {
	Mutex
	RLock()
	RUnlock()
}

func NewRWMutex

func NewRWMutex() RWMutex

type TimeoutCond added in v0.14.22

type TimeoutCond struct {
	L sync.Locker
	// contains filtered or unexported fields
}

TimeoutCond is a variant on Cond. It has roughly the same semantics regarding 'L' - it must be held both when broadcasting and when calling TimeoutCondWaiter.Wait() Call Broadcast() to broadcast to all waiters on the TimeoutCond. Call SetupWait to create a TimeoutCondWaiter configured with the given timeout, which can then be used to listen for broadcasts.

func NewTimeoutCond added in v0.14.22

func NewTimeoutCond(l sync.Locker) *TimeoutCond

func (*TimeoutCond) Broadcast added in v0.14.22

func (c *TimeoutCond) Broadcast()

func (*TimeoutCond) SetupWait added in v0.14.22

func (c *TimeoutCond) SetupWait(timeout time.Duration) *TimeoutCondWaiter

type TimeoutCondWaiter added in v0.14.22

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

TimeoutCondWaiter is a type allowing a consumer to wait on a TimeoutCond with a timeout. Wait() may be called multiple times, and will return true every time that the TimeoutCond is broadcast to. Once the configured timeout expires, Wait() will return false. Call Stop() to release resources once this TimeoutCondWaiter is no longer needed.

func (*TimeoutCondWaiter) Stop added in v0.14.22

func (w *TimeoutCondWaiter) Stop()

func (*TimeoutCondWaiter) Wait added in v0.14.22

func (w *TimeoutCondWaiter) Wait() bool

type WaitGroup

type WaitGroup interface {
	Add(int)
	Done()
	Wait()
}

func NewWaitGroup

func NewWaitGroup() WaitGroup

Jump to

Keyboard shortcuts

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