contextlock

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextLock

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

func NewContextLock

func NewContextLock() *ContextLock

NewContextLock creates a new context lock ContextLock allows to create a lock which can't be double-locked It's useful to avoid race conditions when a function is called in multiple places and the function needs to be called only once.

func (*ContextLock) Lock

func (l *ContextLock) Lock(ctx context.Context) context.Context

func (*ContextLock) Unlock

func (l *ContextLock) Unlock(ctx context.Context) context.Context

Jump to

Keyboard shortcuts

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