Internal

internal/platform/filelock

Package filelock provides advisory cross-process file locking for stores that read-modify-write shared state.

import "github.com/nilstate/scafld/v2/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.

Functions

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

Source: internal/platform/filelock/filelock.go:10

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.