Documentation
¶
Overview ¶
Package lock provides an advisory file lock around the critical section that mutates tasks.txt (SPEC §6.4). It locks a dedicated lock file — never tasks.txt itself — so the atomic rename that replaces tasks.txt can't swap the inode out from under a held lock.
flock(2) is local-filesystem only; on NFS it may silently no-op. The store is documented as local-FS only for concurrent access.
Index ¶
Constants ¶
View Source
const DefaultTimeout = 2 * time.Second
DefaultTimeout bounds how long Acquire waits before reporting the store busy.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handle ¶
type Handle struct {
// contains filtered or unexported fields
}
Handle is a held lock. Release must be called (typically via defer).
Click to show internal directories.
Click to hide internal directories.