2015-10-19 16:43:56 -04:00
|
|
|
/*
|
|
|
|
Package locker provides a mechanism for creating finer-grained locking to help
|
|
|
|
free up more global locks to handle other tasks.
|
|
|
|
|
|
|
|
The implementation looks close to a sync.Mutex, however the user must provide a
|
|
|
|
reference to use to refer to the underlying lock when locking and unlocking,
|
|
|
|
and unlock may generate an error.
|
|
|
|
|
|
|
|
If a lock with a given name does not exist when `Lock` is called, one is
|
|
|
|
created.
|
|
|
|
Lock references are automatically cleaned up on `Unlock` if nothing else is
|
|
|
|
waiting for the lock.
|
|
|
|
*/
|
2018-02-05 16:05:59 -05:00
|
|
|
package locker // import "github.com/docker/docker/pkg/locker"
|
2015-10-19 16:43:56 -04:00
|
|
|
|
|
|
|
import (
|
2020-09-10 16:15:40 -04:00
|
|
|
"github.com/moby/locker"
|
2015-10-19 16:43:56 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
// ErrNoSuchLock is returned when the requested lock does not exist
|
2020-09-10 16:15:40 -04:00
|
|
|
// Deprecated: use github.com/moby/locker.ErrNoSuchLock
|
|
|
|
var ErrNoSuchLock = locker.ErrNoSuchLock
|
2015-10-19 16:43:56 -04:00
|
|
|
|
|
|
|
// Locker provides a locking mechanism based on the passed in reference name
|
2020-09-10 16:15:40 -04:00
|
|
|
// Deprecated: use github.com/moby/locker.Locker
|
|
|
|
type Locker = locker.Locker
|
2015-10-19 16:43:56 -04:00
|
|
|
|
|
|
|
// New creates a new Locker
|
2020-09-10 16:15:40 -04:00
|
|
|
// Deprecated: use github.com/moby/locker.New
|
|
|
|
var New = locker.New
|