sync

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package sync implements synchronization primitives similar to those provided by the standard Go implementation. These are not safe to access from within interrupts, or from another thread. The primitives also lack any fairness guarantees, similar to channels and the scheduler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cond added in v0.14.0

type Cond struct {
	L Locker
	// contains filtered or unexported fields
}

func NewCond added in v0.19.0

func NewCond(l Locker) *Cond

func (*Cond) Broadcast added in v0.14.0

func (c *Cond) Broadcast()

func (*Cond) Signal added in v0.14.0

func (c *Cond) Signal()

func (*Cond) Wait added in v0.14.0

func (c *Cond) Wait()

type Locker added in v0.14.0

type Locker interface {
	Lock()
	Unlock()
}

type Map added in v0.13.0

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

func (*Map) Delete added in v0.13.0

func (m *Map) Delete(key interface{})

func (*Map) Load added in v0.13.0

func (m *Map) Load(key interface{}) (value interface{}, ok bool)

func (*Map) LoadOrStore added in v0.13.0

func (m *Map) LoadOrStore(key, value interface{}) (actual interface{}, loaded bool)

func (*Map) Range added in v0.14.0

func (m *Map) Range(f func(key, value interface{}) bool)

func (*Map) Store added in v0.13.0

func (m *Map) Store(key, value interface{})

type Mutex

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

func (*Mutex) Lock

func (m *Mutex) Lock()

func (*Mutex) Unlock

func (m *Mutex) Unlock()

type Once

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

func (*Once) Do

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

type Pool

type Pool struct {
	New func() interface{}
}

Pool is a very simple implementation of sync.Pool. It does not actually implement a pool.

func (*Pool) Get

func (p *Pool) Get() interface{}

Get returns the value of calling Pool.New().

func (*Pool) Put

func (p *Pool) Put(x interface{})

Put drops the value put into the pool.

type RWMutex

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

func (*RWMutex) Lock

func (rw *RWMutex) Lock()

func (*RWMutex) RLock

func (rw *RWMutex) RLock()

func (*RWMutex) RLocker added in v0.14.0

func (rw *RWMutex) RLocker() Locker

RLocker returns a Locker interface that implements the Lock and Unlock methods by calling rw.RLock and rw.RUnlock.

func (*RWMutex) RUnlock

func (rw *RWMutex) RUnlock()

func (*RWMutex) Unlock

func (rw *RWMutex) Unlock()

type WaitGroup added in v0.14.0

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

func (*WaitGroup) Add added in v0.14.0

func (wg *WaitGroup) Add(delta int)

func (*WaitGroup) Done added in v0.14.0

func (wg *WaitGroup) Done()

func (*WaitGroup) Wait added in v0.14.0

func (wg *WaitGroup) Wait()

Jump to

Keyboard shortcuts

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