synchronization

package
v0.0.0-...-f9509b0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CancellableLock

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

func NewCancellableLock

func NewCancellableLock() *CancellableLock

func (*CancellableLock) Lock

func (l *CancellableLock) Lock()

func (*CancellableLock) LockIfNotCancelled

func (l *CancellableLock) LockIfNotCancelled(ctx context.Context) error

lockIfNotCancelled is attempting to take the lock but gives up if the context is cancelled This allows putting a time limit on the lock, as well as locking within a cancellable call lockIfNotCancelled returns an error if the ctx was cancelled (without taking the lock), otherwise returns nil user must call unlock to release the lock iif the error returned is nil

func (*CancellableLock) Unlock

func (l *CancellableLock) Unlock()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳