lock

package
v0.54.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithExclusiveFileLock

func WithExclusiveFileLock(lockPath string, fn func() error) error

WithExclusiveFileLock runs fn while holding an exclusive advisory lock on lockPath. The lock is released when fn returns.

The lock is taken on lockPath (not the target file being updated) so callers can safely use atomic rename for the real data file without invalidating the lock (flock is per-inode).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL