ctxlock

package
v1.5.48 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Overview

Package ctxlock is deprecated. Use ctxlock/v2 instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Locker deprecated

type Locker struct{}

Locker provides context-scoped locks.

Deprecated: Use ctxlock/v2 instead.

func New deprecated

func New(ctx context.Context, p any) (*Locker, error)

New creates a Locker that will pull connections from the provided pool.

The provided context is only used for logging and initial setup. Close must be called to release held resources.

Deprecated: Use ctxlock/v2 instead.

func (*Locker) Close deprecated

func (l *Locker) Close(_ context.Context) (_ error)

Close spins down background goroutines and frees resources.

Deprecated: Use ctxlock/v2 instead.

func (*Locker) Lock deprecated

func (l *Locker) Lock(parent context.Context, key string) (context.Context, context.CancelFunc)

Lock attempts to obtain the named lock until it succeeds or the passed Context is canceled.

Deprecated: Use ctxlock/v2 instead.

func (*Locker) TryLock deprecated

func (l *Locker) TryLock(parent context.Context, key string) (context.Context, context.CancelFunc)

TryLock attempts to lock on the provided key.

If unsuccessful, an already-canceled Context will be returned.

If successful, the returned Context will be parented to the passed-in Context and also to the underlying connection used for the lock.

Deprecated: Use ctxlock/v2 instead.

Directories

Path Synopsis
Package ctxlock provides a locking mechanism based on context cancellation.
Package ctxlock provides a locking mechanism based on context cancellation.

Jump to

Keyboard shortcuts

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