Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrLockBusy = errors.New("lock busy: held by another process")
ErrLockBusy is returned when a non-blocking lock cannot be acquired because another process holds a conflicting lock.
var ErrLocked = errProcessLocked
ErrLocked is returned when a lock cannot be acquired because it is held by another process.
Functions ¶
func FlockExclusiveBlocking ¶ added in v0.26.1
FlockExclusiveBlocking acquires an exclusive blocking lock on the file. This will wait until the lock is available.
func FlockExclusiveNonBlock ¶ added in v0.49.4
FlockExclusiveNonBlock acquires an exclusive non-blocking lock on the file. Returns ErrLockBusy if any lock (shared or exclusive) is already held.
func FlockExclusiveNonBlocking ¶ added in v0.49.2
FlockExclusiveNonBlocking attempts to acquire an exclusive lock without blocking. Returns ErrLocked if the lock is held by another process.
func FlockSharedNonBlock ¶ added in v0.49.4
FlockSharedNonBlock acquires a shared non-blocking lock on the file. Multiple processes can hold shared locks concurrently. Returns ErrLockBusy if an exclusive lock is already held.
func FlockUnlock ¶ added in v0.26.1
FlockUnlock releases a lock on the file.
Types ¶
This section is empty.