lock

package
v0.0.0-...-f602c80 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Open File Description Locks
	//
	// Usually record locks held by a process are released on *any* close and are
	// not inherited across a fork().
	// These cmd values will set locks that conflict with process-associated
	// record  locks, but are "owned" by the open file description, not the
	// process. This means that they are inherited across fork() like BSD (flock)
	// locks, and they are only released automatically when the last reference to
	// the the open file against which they were acquired is put.
	//
	// source /usr/include/bits/fcntl-linux.h
	F_OFD_GETLK  = 37
	F_OFD_SETLK  = 37
	F_OFD_SETLKW = 38
)

Variables

View Source
var (
	ErrLockLocked = fmt.Errorf("lock: lock is locked")
)

Functions

This section is empty.

Types

type Locker

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

func New

func New(path string, retryInterval time.Duration) *Locker

New returns a new Locker

func (*Locker) Lock

func (l *Locker) Lock() error

todo: Lock locks ...

func (*Locker) TryLock

func (l *Locker) TryLock() error

todo: TryLock ...

func (*Locker) Unlock

func (l *Locker) Unlock() error

todo: Unlock ...

Jump to

Keyboard shortcuts

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