MCPcopy
hub / github.com/go-redsync/redsync / Lock

Method Lock

mutex.go:65–67  ·  view source on GitHub ↗

Lock locks m. In case it returns an error on failure, you may retry to acquire the lock by calling this method again.

()

Source from the content-addressed store, hash-verified

63
64// Lock locks m. In case it returns an error on failure, you may retry to acquire the lock by calling this method again.
65func (m *Mutex) Lock() error {
66 return m.LockContext(context.Background())
67}
68
69// LockContext locks m. In case it returns an error on failure, you may retry to acquire the lock by calling this method again.
70func (m *Mutex) LockContext(ctx context.Context) error {

Callers 14

TestMutexAlreadyLockedFunction · 0.95
TestValidFunction · 0.95
TestMutexLockUnlockSplitFunction · 0.95
TestRedsyncFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
TestMutexFunction · 0.80
TestMutexExtendFunction · 0.80
TestMutexExtendExpiredFunction · 0.80

Calls 1

LockContextMethod · 0.95

Tested by 11

TestMutexAlreadyLockedFunction · 0.76
TestValidFunction · 0.76
TestMutexLockUnlockSplitFunction · 0.76
TestRedsyncFunction · 0.76
TestMutexFunction · 0.64
TestMutexExtendFunction · 0.64
TestMutexExtendExpiredFunction · 0.64
TestMutexUnlockExpiredFunction · 0.64
TestMutexQuorumFunction · 0.64