MCPcopy Create free account
hub / github.com/containerd/nerdctl / Lock

Function Lock

pkg/internal/filesystem/lock.go:39–41  ·  view source on GitHub ↗

Lock places an advisory write lock on the file, blocking until it can be locked. If Lock returns nil, no other process will be able to place a read or write lock on the file until this process exits, closes f, or calls Unlock on it.

(path string)

Source from the content-addressed store, hash-verified

37// If Lock returns nil, no other process will be able to place a read or write lock on the file until
38// this process exits, closes f, or calls Unlock on it.
39func Lock(path string) (file *os.File, err error) {
40 return commonlock(path, writeLock)
41}
42
43// ReadOnlyLock places an advisory read lock on the file, blocking until it can be locked.
44//

Callers 7

LockFunction · 0.92
LockMethod · 0.92
TestLockDirFunction · 0.92
TestLockFileFunction · 0.92
MFunction · 0.92
RunFunction · 0.92
WithLockFunction · 0.70

Calls 1

commonlockFunction · 0.85

Tested by 2

TestLockDirFunction · 0.74
TestLockFileFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…