lock

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package lock provides per-game-install exclusive locking for apply and unapply operations. It uses flock(2) to prevent concurrent modifications to the same game directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GameInstall

func GameInstall(locksDir string, gameInstallID int64) (unlock func(), err error)

GameInstall acquires an exclusive non-blocking flock on a lockfile for the given game install ID. It returns an unlock function that must be called when the operation is complete.

If another process already holds the lock, an error is returned immediately rather than blocking. The lock is also released automatically by the OS if the process exits or crashes.

locksDir should be a stable per-installation directory, e.g. $XDG_STATE_HOME/modctl/locks.

Types

This section is empty.

Jump to

Keyboard shortcuts

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