locks

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChanLock

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

ChanLock implements a contextlock.ContextLocker that uses a Go channel to provide atomic locking and unlocking with context.Context cancellation support.

func NewChanLock

func NewChanLock() *ChanLock

NewChanLock creates a new channel-based contextlock.ContextLocker.

func (*ChanLock) ContextLock

func (cl *ChanLock) ContextLock(ctx context.Context) error

ContextLock implements contextlock.ContextLocker.

func (*ChanLock) ContextUnlock

func (cl *ChanLock) ContextUnlock(ctx context.Context) error

ContextUnlock implements contextlock.ContextLocker.

func (*ChanLock) Lock

func (cl *ChanLock) Lock()

Lock implements sync.Locker.

func (*ChanLock) Unlock

func (cl *ChanLock) Unlock()

Unlock implements sync.Locker.

Jump to

Keyboard shortcuts

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