flock

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package flock provides a small cross-process advisory-lock primitive built on POSIX flock (Unix) / LockFileEx (Windows). It exists so that checkpoint and strategy can both serialize on shared resources without one taking the other as an import dependency.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Acquire

func Acquire(path string) (release func(), err error)

Acquire takes an exclusive advisory lock on path, creating the file if needed. The returned release closes the file, which drops the flock. Callers must invoke release exactly once. The lock file persists between runs — flock state is held by the file descriptor, not by the inode on disk — so the lockfile contents are immaterial.

Types

This section is empty.

Jump to

Keyboard shortcuts

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