ownerlock

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ownerlock makes one process the owner of a data directory.

Index

Constants

This section is empty.

Variables

View Source
var ErrAnotherOwner = errors.New("another process owns the data directory")

ErrAnotherOwner: another process holds the data directory's lock.

Functions

func Acquire

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

Acquire creates dataDir (0700) and takes an exclusive, non-blocking lock on <dataDir>/godwit.lock; it fails with ErrAnotherOwner if someone holds it. On Unix the directory must belong to the current user and is tightened to 0700; on Windows it relies on the user directory's default ACL, and the ACL of a custom data directory is not checked. The lock is released by release or when the process exits, however it exits.

Types

This section is empty.

Jump to

Keyboard shortcuts

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