concurrent

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(key interface{}, f func() (interface{}, error)) (interface{}, error)

Do .

func Lock

func Lock(key interface{})

Lock .

func RLock

func RLock(key interface{})

RLock .

func RUnlock

func RUnlock(key interface{})

RUnlock .

func Unlock

func Unlock(key interface{})

Unlock .

Types

type Batch

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

Batch .

func NewBatch

func NewBatch() *Batch

NewBatch .

func (*Batch) Do

func (o *Batch) Do(key interface{}, f func() (interface{}, error)) (interface{}, error)

Do .

type Map

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

func NewMap

func NewMap(bucketNum int) *Map

func (*Map) Delete

func (m *Map) Delete(k string)

func (*Map) ForEach

func (m *Map) ForEach(f func(k string, v interface{}) bool)

func (*Map) Get

func (m *Map) Get(k string) (interface{}, bool)

func (*Map) Set

func (m *Map) Set(k string, v interface{})

func (*Map) Size

func (m *Map) Size() int64

type Mutex

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

Mutex .

func NewMutex

func NewMutex() *Mutex

NewMutex .

func (*Mutex) Lock

func (m *Mutex) Lock(key interface{})

Lock .

func (*Mutex) Unlock

func (m *Mutex) Unlock(key interface{})

Unlock .

type RWMutex

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

RWMutex .

func NewRWMutex

func NewRWMutex() *RWMutex

NewRWMutex .

func (*RWMutex) Lock

func (m *RWMutex) Lock(key interface{})

Lock .

func (*RWMutex) RLock

func (m *RWMutex) RLock(key interface{})

RLock .

func (*RWMutex) RUnlock

func (m *RWMutex) RUnlock(key interface{})

RUnlock .

func (*RWMutex) Unlock

func (m *RWMutex) Unlock(key interface{})

Unlock .

Jump to

Keyboard shortcuts

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