lock

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LockDo

func LockDo(locker sync.Locker, f func())

func LockGet

func LockGet[V any](locker sync.Locker, f func() V) V

func LockGetDouble

func LockGetDouble[V1, V2 any](locker sync.Locker, f func() (V1, V2)) (V1, V2)

func LockGetTriple

func LockGetTriple[V1, V2, V3 any](locker sync.Locker, f func() (V1, V2, V3)) (V1, V2, V3)

func RLockDo

func RLockDo(locker RLocker, f func())

func RLockGet

func RLockGet[V any](locker RLocker, f func() V) V

func RLockGetDouble

func RLockGetDouble[V1, V2 any](locker RLocker, f func() (V1, V2)) (V1, V2)

func RLockGetTriple

func RLockGetTriple[V1, V2, V3 any](locker RLocker, f func() (V1, V2, V3)) (V1, V2, V3)

Types

type LockWrapper

type LockWrapper[T any] struct {
	Elem T
	sync.Mutex
}

type RLocker

type RLocker interface {
	RLock()

	RUnlock()
}

Jump to

Keyboard shortcuts

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