lock

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProbeMountLock

func ProbeMountLock(mountName string, lockFile string) (busy bool, pid int, err error)

ProbeMountLock tests whether a mount lock is currently held without acquiring it. Returns busy=true when another process holds the lock. The returned pid is best-effort (read from the lock file content) and may be 0.

Types

type FileLock

type FileLock struct {
	// contains filtered or unexported fields
}

FileLock is a POSIX advisory file lock held via flock(2).

func AcquireMountLock

func AcquireMountLock(mountName string, lockFile string) (*FileLock, error)

AcquireMountLock acquires one of the v1 locks for a mount (daemon.lock or job.lock).

func (*FileLock) Close

func (l *FileLock) Close() error

Close releases the lock and closes the underlying file descriptor.

Jump to

Keyboard shortcuts

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