lock

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeLock

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

func NewLock

func NewLock() *TimeLock

NewLock returns new lock (mutex) with a timeout option.

func (*TimeLock) Lock

func (tl *TimeLock) Lock()

Lock unconditionally blocks the execution.

func (*TimeLock) LockFor

func (tl *TimeLock) LockFor(d time.Duration)

LockFor blocks the execution at most for the given period of time.

func (*TimeLock) Unlock

func (tl *TimeLock) Unlock()

Unlock removes the current block if any.

Jump to

Keyboard shortcuts

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