flock

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lock

func Lock(f *os.File) error

use fcntl POSIX locks for the most consistent behavior across platforms, and hopefully some compatibility over NFS and CIFS.

func LockBlocking

func LockBlocking(ctx context.Context, f *os.File) error

LockBlocking is like Lock except that if the lock is currently contended then it blocks until it becomes available.

If the given context is cancelled then it returns early with the cancellation error.

func Unlock

func Unlock(f *os.File) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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