MCPcopy
hub / github.com/docker/docker-agent / Unlock

Method Unlock

pkg/memory/database/lock.go:132–153  ·  view source on GitHub ↗

Unlock releases the advisory lock and closes the sentinel file descriptor.

()

Source from the content-addressed store, hash-verified

130
131// Unlock releases the advisory lock and closes the sentinel file descriptor.
132func (l *FileLock) Unlock() error {
133 l.mu.Lock()
134 defer l.mu.Unlock()
135
136 if l.file == nil {
137 return nil
138 }
139
140 f := l.file
141 l.file = nil
142
143 unlockErr := unlockFile(f)
144 closeErr := f.Close()
145 l.processLock.Unlock()
146 if unlockErr != nil {
147 return fmt.Errorf("unlocking memory lock file %q: %w", l.path, unlockErr)
148 }
149 if closeErr != nil {
150 return fmt.Errorf("closing memory lock file %q: %w", l.path, closeErr)
151 }
152 return nil
153}

Callers 15

ensureDBMethod · 0.95
withWriteLockMethod · 0.95
StoreMethod · 0.45
maybeReloadMethod · 0.45
IsStartedMethod · 0.45
StartMethod · 0.45
ToolsMethod · 0.45
StopMethod · 0.45
ShouldReportFailureMethod · 0.45

Calls 3

unlockFileFunction · 0.70
CloseMethod · 0.65
LockMethod · 0.45

Tested by 15

CloseMethod · 0.36
ConnectMethod · 0.36
handlerMethod · 0.36
InitializeMethod · 0.36
WaitMethod · 0.36
CloseMethod · 0.36
InitializeMethod · 0.36
ListToolsMethod · 0.36