sync2

package
v0.0.0-...-c98f1fc Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2018 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BiasedMutex

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

BiasedMutex is a RWMutex that allows tuning progress making on both writing and reading side. Tries to let through multiple readers and then multiple writers.

BiasedMutex controls the flow by keeping track on how many reads / writes there have been. Once there have been RLock()-s called over `ReaderThreshold`, then RLock will wait in cased there are any writes pending. BiasedMutex will continue letting through at most `WriterThreshold` writers. Once writers have been exhausted the variables are reset.

func NewBiasedMutex

func NewBiasedMutex() *BiasedMutex

func (*BiasedMutex) Lock

func (m *BiasedMutex) Lock()

func (*BiasedMutex) RLock

func (m *BiasedMutex) RLock()

func (*BiasedMutex) RUnlock

func (m *BiasedMutex) RUnlock()

func (*BiasedMutex) SetReaderThreshold

func (m *BiasedMutex) SetReaderThreshold(x int)

func (*BiasedMutex) SetWriterThreshold

func (m *BiasedMutex) SetWriterThreshold(x int)

func (*BiasedMutex) Unlock

func (m *BiasedMutex) Unlock()

type Mutex

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

func (*Mutex) Lock

func (mu *Mutex) Lock()

func (*Mutex) MustOwn

func (mu *Mutex) MustOwn()

func (*Mutex) Own

func (mu *Mutex) Own() bool

func (*Mutex) Unlock

func (mu *Mutex) Unlock()

type SpinMutex

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

func (*SpinMutex) Lock

func (m *SpinMutex) Lock()

func (*SpinMutex) Unlock

func (m *SpinMutex) Unlock()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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