sync

package
v3.3.14 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PathMutex

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

PathMutex provides per-path locking to allow concurrent operations on different paths

func NewPathMutex

func NewPathMutex() *PathMutex

NewPathMutex creates a new path mutex

func (*PathMutex) Lock

func (pm *PathMutex) Lock(path string)

Lock acquires a lock for the given path

func (*PathMutex) Unlock

func (pm *PathMutex) Unlock(path string)

Unlock releases the lock for the given path

type Pool

type Pool[T any] struct {
	// contains filtered or unexported fields
}

Pool is a generic wrapper around sync.Pool for type-safe pooling

func NewPool

func NewPool[T any](newFn func() T) *Pool[T]

NewPool creates a new type-safe pool with the given constructor function

func (*Pool[T]) Get

func (p *Pool[T]) Get() T

Get retrieves an item from the pool

func (*Pool[T]) Put

func (p *Pool[T]) Put(x T)

Put returns an item to the pool

Jump to

Keyboard shortcuts

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