concurrency

package
v0.0.0-...-8a3d261 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LockBoth

func LockBoth(a, b TryLock)

Types

type HashLocker

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

func NewHashLocker

func NewHashLocker() *HashLocker

func (*HashLocker) Lock

func (h *HashLocker) Lock(hash crypto.Hash)

func (*HashLocker) LockFor

func (h *HashLocker) LockFor(hash crypto.Hash) TryLock

func (*HashLocker) TryLock

func (h *HashLocker) TryLock(hash crypto.Hash) bool

func (*HashLocker) Unlock

func (h *HashLocker) Unlock(hash crypto.Hash)

type PrioritySemaphore

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

func NewPrioritySemaphore

func NewPrioritySemaphore(capacity int) *PrioritySemaphore

func (*PrioritySemaphore) Acquire

func (p *PrioritySemaphore) Acquire(priority int)

func (*PrioritySemaphore) LockFor

func (p *PrioritySemaphore) LockFor(priority int) TryLock

func (*PrioritySemaphore) Release

func (p *PrioritySemaphore) Release()

func (*PrioritySemaphore) TryAcquire

func (p *PrioritySemaphore) TryAcquire() bool

type TryLock

type TryLock interface {
	Lock()
	Unlock()
	TryLock() bool
}

Jump to

Keyboard shortcuts

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