ErrNoSuchLock is returned when the requested lock does not exist
var ErrNoSuchLock = errors.New("no such lock")
Locker provides a locking mechanism based on the passed in reference name
type Locker struct {
// contains filtered or unexported fields
}
func New() *Locker
New creates a new Locker
func (l *Locker) Lock(name string)
Lock locks a mutex with the given name. If it doesn't exist, one is created
func (l *Locker) Unlock(name string) error
Unlock unlocks the mutex with the given name If the given lock is not being waited on by any other callers, it is deleted