locker

package
v0.3.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithLock

func WithLock(locker Locker, f func())

func WithLockReturn

func WithLockReturn[T any](locker Locker, f func() (T, error)) (T, error)

func WithRLock

func WithRLock(locker RWLocker, f func())

func WithRLockReturn

func WithRLockReturn[T any](locker RWLocker, f func() (T, error)) (T, error)

Types

type Locker

type Locker sync.Locker

type RWLocker

type RWLocker interface {
	RLock()
	RUnlock()
}

Jump to

Keyboard shortcuts

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