chanlock

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 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. This lock is resolved locally and does not require network calls.

func NewChanLock

func NewChanLock() *ChanLock

NewChanLock creates a new channel-based contextlock.ContextLocker.

func (*ChanLock) Lock

func (cl *ChanLock) Lock()

Lock implements sync.Locker.

func (*ChanLock) LockContext

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

LockContext implements contextlock.ContextLocker.

func (*ChanLock) Unlock

func (cl *ChanLock) Unlock()

Unlock implements sync.Locker.

func (*ChanLock) UnlockContext

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

UnlockContext implements contextlock.ContextLocker.

Jump to

Keyboard shortcuts

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