sync

package
v3.3.331 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 PathRWMutex added in v3.3.285

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

PathRWMutex provides shared read locks and exclusive mutation locks per path.

func NewPathRWMutex added in v3.3.285

func NewPathRWMutex() *PathRWMutex

func (*PathRWMutex) Lock added in v3.3.285

func (pm *PathRWMutex) Lock(path string)

func (*PathRWMutex) RLock added in v3.3.285

func (pm *PathRWMutex) RLock(path string)

func (*PathRWMutex) RUnlock added in v3.3.285

func (pm *PathRWMutex) RUnlock(path string)

func (*PathRWMutex) Unlock added in v3.3.285

func (pm *PathRWMutex) Unlock(path string)

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