locker.go 1.0 KB

123456789101112131415161718192021222324252627282930
  1. /*
  2. Package locker provides a mechanism for creating finer-grained locking to help
  3. free up more global locks to handle other tasks.
  4. The implementation looks close to a sync.Mutex, however the user must provide a
  5. reference to use to refer to the underlying lock when locking and unlocking,
  6. and unlock may generate an error.
  7. If a lock with a given name does not exist when `Lock` is called, one is
  8. created.
  9. Lock references are automatically cleaned up on `Unlock` if nothing else is
  10. waiting for the lock.
  11. */
  12. package locker // import "github.com/docker/docker/pkg/locker"
  13. import (
  14. "github.com/moby/locker"
  15. )
  16. // ErrNoSuchLock is returned when the requested lock does not exist
  17. // Deprecated: use github.com/moby/locker.ErrNoSuchLock
  18. var ErrNoSuchLock = locker.ErrNoSuchLock
  19. // Locker provides a locking mechanism based on the passed in reference name
  20. // Deprecated: use github.com/moby/locker.Locker
  21. type Locker = locker.Locker
  22. // New creates a new Locker
  23. // Deprecated: use github.com/moby/locker.New
  24. var New = locker.New