keymutex

package
v0.0.0-...-213e13b Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2016 License: Apache-2.0, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyMutex

type KeyMutex interface {
	// Aquires a lock associated with the specified ID, creates the lock if one doesn't already exist.
	LockKey(id string)

	// Releases the lock associated with the specified ID.
	// Returns an error if the specified ID doesn't exist.
	UnlockKey(id string) error
}

KeyMutex is a thread-safe interface for aquiring locks on arbitrary strings.

func NewKeyMutex

func NewKeyMutex() KeyMutex

Returns a new instance of a key mutex.

Jump to

Keyboard shortcuts

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