base: github.com/grailbio/base/flock Index | Files

package flock

import "github.com/grailbio/base/flock"

Package flock implements a simple POSIX file-based advisory lock.

Index

Package Files

flock_unix.go

type T Uses

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

func New Uses

func New(path string) *T

New creates an object that locks the given path.

func (*T) Lock Uses

func (f *T) Lock(ctx context.Context) (err error)

Lock locks the file. Iff Lock() returns nil, the caller must call Unlock() later.

func (*T) Unlock Uses

func (f *T) Unlock() error

Unlock unlocks the file.

Package flock imports 4 packages (graph) and is imported by 1 packages. Updated 2019-07-22. Refresh now. Tools for package owners.