filelock

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package filelock takes locks that upstream pi can interoperate with.

Upstream guards its shared state files with npm proper-lockfile, which creates the lock as a DIRECTORY via mkdir and refreshes its mtime while held. A POSIX flock on the same path leaves a zero-byte regular file behind instead, and proper-lockfile never treats a plain file as stale, so it then fails with EEXIST forever. One pigo write is enough to wedge the TypeScript runtime permanently. Every path both runtimes touch must lock through here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Acquire

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

Acquire locks path+".lock" and returns the release. Contending writers back off with jitter: lockstep retries let the same loser keep losing, which dropped a double-digit percentage of concurrent settings writes before it was jittered.

Types

This section is empty.

Jump to

Keyboard shortcuts

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