MCPcopy
hub / github.com/dagger/container-use / WithLock

Method WithLock

repository/flock.go:78–80  ·  view source on GitHub ↗

WithLock executes a function while holding an exclusive lock for the specified lock type

(ctx context.Context, lockType LockType, fn func() error)

Source from the content-addressed store, hash-verified

76
77// WithLock executes a function while holding an exclusive lock for the specified lock type
78func (rlm *RepositoryLockManager) WithLock(ctx context.Context, lockType LockType, fn func() error) error {
79 return rlm.GetLock(lockType).WithLock(ctx, fn)
80}
81
82// WithRLock executes a function while holding a shared (read) lock for the specified lock type.
83// Multiple readers can hold the lock simultaneously, but writers will block until all readers release.

Callers

nothing calls this directly

Calls 2

GetLockMethod · 0.95
WithLockMethod · 0.45

Tested by

no test coverage detected