Documentation
¶
Overview ¶
Package filelock implements only the platform file-lock primitive. The parent driver resolves paths, coordinates process-wide lock identities, and retains ownership across session and transaction callback lifetimes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Acquire ¶
func Acquire(ctx context.Context, path string, wait bool) (release func() error, acquired bool, err error)
Acquire takes an exclusive flock on path, creating the file when needed. With wait it polls with LOCK_NB so ctx ends the wait; without it, it reports acquired false at once when another process holds the lock. The kernel drops the lock when the process exits, so a crashed holder never blocks others. The returned release function unlocks and closes the file.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.