Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTimeout indicates that the lock attempt timed out. ErrTimeout = errors.New("lock timeout exceeded") // ErrLocked indicates TryLock failed because the lock was already locked. ErrLocked = errors.New("file is already locked") )
Functions ¶
This section is empty.
Types ¶
type Lock ¶
type Lock struct {
// contains filtered or unexported fields
}
Lock implements cross-process locks using syscalls. This implementation is based on flock syscall.
func (*Lock) LockWithTimeout ¶
LockWithTimeout tries to lock the lock until the timeout expires. If the timeout expires, this method will return ErrTimeout.
Click to show internal directories.
Click to hide internal directories.