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

Method WithRLock

repository/flock.go:135–142  ·  view source on GitHub ↗

WithRLock executes a function while holding a shared lock.

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

Source from the content-addressed store, hash-verified

133
134// WithRLock executes a function while holding a shared lock.
135func (rl *RepositoryLock) WithRLock(ctx context.Context, fn func() error) error {
136 if err := rl.RLock(ctx); err != nil {
137 return err
138 }
139 defer rl.Unlock()
140
141 return fn()
142}
143
144// hashString creates a simple hash of a string for use in filenames
145func hashString(s string) uint32 {

Callers 3

CreateMethod · 0.45
loadStateMethod · 0.45
WithRLockMethod · 0.45

Calls 2

RLockMethod · 0.95
UnlockMethod · 0.95

Tested by

no test coverage detected