lock

package
v0.2.134 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitUntilLock

func WaitUntilLock(mutex MutexTable, key string, timeout, sleep time.Duration) bool

Types

type MemoryMutexTable

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

func NewMemoryMutexTable

func NewMemoryMutexTable(requestBuffer int) *MemoryMutexTable

func (MemoryMutexTable) IsLocked

func (mt MemoryMutexTable) IsLocked(key string) bool

func (*MemoryMutexTable) Lock

func (mt *MemoryMutexTable) Lock(key string) bool

func (*MemoryMutexTable) Unlock

func (mt *MemoryMutexTable) Unlock(key string) bool

type MutexTable

type MutexTable interface {
	// Lock key
	// return that lock is succeeded
	Lock(key string) bool

	// Unlock key
	// return that unlock is succeeded
	Unlock(key string) bool

	// IsLocked return that key is locked
	IsLocked(key string) bool
}

Jump to

Keyboard shortcuts

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