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

Method Lock

repository/flock.go:89–101  ·  view source on GitHub ↗

Lock acquires an exclusive repository lock.

(ctx context.Context)

Source from the content-addressed store, hash-verified

87
88// Lock acquires an exclusive repository lock.
89func (rl *RepositoryLock) Lock(ctx context.Context) error {
90 const retryDelay = 100 * time.Millisecond
91
92 locked, err := rl.flock.TryLockContext(ctx, retryDelay)
93 if err != nil {
94 return fmt.Errorf("failed to acquire exclusive lock: %w", err)
95 }
96 if !locked {
97 return fmt.Errorf("failed to acquire exclusive lock within context timeout")
98 }
99
100 return nil
101}
102
103// RLock acquires a shared repository lock.
104// Multiple processes can hold shared locks simultaneously.

Callers 10

WithLockMethod · 0.95
setCurrentEnvironmentIDFunction · 0.80
setCurrentEnvironmentFunction · 0.80
GetLockMethod · 0.80
applyMethod · 0.80
AddMethod · 0.80
ClearMethod · 0.80
StringMethod · 0.80
PopMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected