Documentation ¶
Overview ¶
SPDX-License-Identifier: Apache-2.0 Copyright Authors of Cilium
Index ¶
Constants ¶
View Source
const ( SETLK = 37 // F_OFD_SETLK SETLKW = 38 // F_OFD_SETLKW )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lockfile ¶
type Lockfile struct {
// contains filtered or unexported fields
}
Lockfile is a simple wrapper around POSIX file locking but it uses Linux's per-fd locks, which makes it safe to use within the same process
func NewLockfile ¶
NewLockfile creates and opens a lockfile, but does not acquire a lock.
func (*Lockfile) Close ¶
Close will close the file, which implicitly removes all locks held. It is an error to re-use a closed Lockfile.
func (*Lockfile) Lock ¶
Lock will attempt to take a lock, blocking until it is able to do so. If exclusive is true, then it will obtain a write, or exclusive, lock
Click to show internal directories.
Click to hide internal directories.