# internal/platform/filelock

Package filelock provides advisory cross-process file locking for stores that read-modify-write shared state. In-process callers must still serialize with their own mutex; the file lock only fences other processes.

## Lock

```go
func Lock(path string) (func(), error)
```

Lock acquires an exclusive advisory lock on path, blocking until the lock is available. It returns a release function that must be called to unlock. On platforms without a supported scafld install channel it is a no-op, preserving the previous in-process-only guarantee rather than failing.

## LockContext

```go
func LockContext(ctx context.Context, path string) (func(), error)
```

LockContext acquires an exclusive advisory lock on path while honoring ctx.
