flock

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithLock

func WithLock(filename string, closure func() error) error

Types

type Flocker

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

func New

func New(filename string) (*Flocker, error)

func (*Flocker) Close

func (m *Flocker) Close() error

Close unlocks the lock and closes the underlying file descriptor.

func (*Flocker) Lock

func (m *Flocker) Lock() error

func (*Flocker) LockWithTimeout

func (m *Flocker) LockWithTimeout(totalWait time.Duration, waitIteration time.Duration) error

func (*Flocker) Unlock

func (m *Flocker) Unlock() error

Jump to

Keyboard shortcuts

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