Documentation
¶
Overview ¶
Package projectlock owns the per-project critical section that serializes every Agent Layer read and mutation of skill sources with ordinary projection.
It was extracted from internal/sync so skill import operations and ordinary sync share one lock rather than each defining their own. The lock combines a per-process token (so goroutines in one binary serialize without relying on advisory-lock reentrancy) with an advisory flock on `.agent-layer/sync.lock` (so separate processes serialize too).
Index ¶
Constants ¶
const FileName = "sync.lock"
FileName is the shared project lock filename. The installer aliases it.
Variables ¶
var ( // ErrPostWriteCleanup identifies a fatal lock cleanup failure after the // locked section already completed its writes successfully. ErrPostWriteCleanup = errors.New("sync generated writes succeeded but post-write lock cleanup failed") )
Functions ¶
Types ¶
type RealSystem ¶ added in v1.0.0
type RealSystem struct{}
RealSystem supplies the ordinary OS lock operations.
func (RealSystem) Close ¶ added in v1.0.0
func (RealSystem) Close(file *os.File) error
Close releases the lock file descriptor.
func (RealSystem) Flock ¶ added in v1.0.0
func (RealSystem) Flock(fd int, how int) error
Flock applies the requested advisory lock operation.
func (RealSystem) Now ¶ added in v1.0.0
func (RealSystem) Now() time.Time
Now returns the current wall clock time.
func (RealSystem) Sleep ¶ added in v1.0.0
func (RealSystem) Sleep(duration time.Duration)
Sleep waits for the requested duration between lock attempts.