kubernetes/vendor/go.etcd.io/etcd/client/v3/concurrency/mutex.go

var ErrLocked

var ErrSessionExpired

type Mutex

func NewMutex(s *Session, pfx string) *Mutex {}

// TryLock locks the mutex if not already locked by another session.
// If lock is held by another session, return immediately after attempting necessary cleanup
// The ctx argument is used for the sending/receiving Txn RPC.
func (m *Mutex) TryLock(ctx context.Context) error {}

// Lock locks the mutex with a cancelable context. If the context is canceled
// while trying to acquire the lock, the mutex tries to clean its stale lock entry.
func (m *Mutex) Lock(ctx context.Context) error {}

func (m *Mutex) tryAcquire(ctx context.Context) (*v3.TxnResponse, error) {}

func (m *Mutex) Unlock(ctx context.Context) error {}

func (m *Mutex) IsOwner() v3.Cmp {}

func (m *Mutex) Key() string {}

// Header is the response header received from etcd on acquiring the lock.
func (m *Mutex) Header() *pb.ResponseHeader {}

type lockerMutex

func (lm *lockerMutex) Lock() {}

func (lm *lockerMutex) Unlock() {}

// NewLocker creates a sync.Locker backed by an etcd mutex.
func NewLocker(s *Session, pfx string) sync.Locker {}