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

Method WithRLock

repository/flock.go:84–86  ·  view source on GitHub ↗

WithRLock executes a function while holding a shared (read) lock for the specified lock type. Multiple readers can hold the lock simultaneously, but writers will block until all readers release.

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

Source from the content-addressed store, hash-verified

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.
84func (rlm *RepositoryLockManager) WithRLock(ctx context.Context, lockType LockType, fn func() error) error {
85 return rlm.GetLock(lockType).WithRLock(ctx, fn)
86}
87
88// Lock acquires an exclusive repository lock.
89func (rl *RepositoryLock) Lock(ctx context.Context) error {

Callers

nothing calls this directly

Calls 2

GetLockMethod · 0.95
WithRLockMethod · 0.45

Tested by

no test coverage detected