flock

package
v0.0.0-...-5eee607 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package flock provides a wrapper around the flock syscall.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lock

type Lock struct {
	Path string
	File *os.File
}

A Lock represents a lock file. Locks are not safe for concurrent use.

func New

func New(file string) *Lock

New creates a file lock

func (*Lock) Lock

func (l *Lock) Lock(blocking bool) error

Lock locks the file at l.Path, blocking if necessary.

func (*Lock) Unlock

func (l *Lock) Unlock() error

Unlock unlocks a locked file.

Jump to

Keyboard shortcuts

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