xsync

package
v0.0.0-...-646ff60 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoA1

func DoA1[A0 any](
	ctx context.Context,
	m Doer,
	fn func(A0),
	a0 A0,
)

func DoA1R1

func DoA1R1[A0, R0 any](
	ctx context.Context,
	m Doer,
	fn func(A0) R0,
	a0 A0,
) R0

func DoA1R2

func DoA1R2[A0, R0, R1 any](
	ctx context.Context,
	m Doer,
	fn func(A0) (R0, R1),
	a0 A0,
) (R0, R1)

func DoA1R4

func DoA1R4[A0, R0, R1, R2, R3 any](
	ctx context.Context,
	m Doer,
	fn func(A0) (R0, R1, R2, R3),
	a0 A0,
) (R0, R1, R2, R3)

func DoA2

func DoA2[A0, A1 any](
	ctx context.Context,
	m Doer,
	fn func(A0, A1),
	a0 A0,
	a1 A1,
)

func DoA2R1

func DoA2R1[A0, A1, R0 any](
	ctx context.Context,
	m Doer,
	fn func(A0, A1) R0,
	a0 A0,
	a1 A1,
) R0

func DoA2R2

func DoA2R2[A0, A1, R0, R1 any](
	ctx context.Context,
	m Doer,
	fn func(A0, A1) (R0, R1),
	a0 A0,
	a1 A1,
) (R0, R1)

func DoA2R3

func DoA2R3[A0, A1, R0, R1, R2 any](
	ctx context.Context,
	m Doer,
	fn func(A0, A1) (R0, R1, R2),
	a0 A0,
	a1 A1,
) (R0, R1, R2)

func DoA3R1

func DoA3R1[A0, A1, A2, R0 any](
	ctx context.Context,
	m Doer,
	fn func(A0, A1, A2) R0,
	a0 A0,
	a1 A1,
	a2 A2,
) R0

func DoA3R2

func DoA3R2[A0, A1, A2, R0, R1 any](
	ctx context.Context,
	m Doer,
	fn func(A0, A1, A2) (R0, R1),
	a0 A0,
	a1 A1,
	a2 A2,
) (R0, R1)

func DoA4R1

func DoA4R1[A0, A1, A2, A3, R0 any](
	ctx context.Context,
	m Doer,
	fn func(A0, A1, A2, A3) R0,
	a0 A0,
	a1 A1,
	a2 A2,
	a3 A3,
) R0

func DoR1

func DoR1[R0 any](
	ctx context.Context,
	m Doer,
	fn func() R0,
) R0

func DoR2

func DoR2[R0, R1 any](
	ctx context.Context,
	m Doer,
	fn func() (R0, R1),
) (R0, R1)

func DoR3

func DoR3[R0, R1, R2 any](
	ctx context.Context,
	m Doer,
	fn func() (R0, R1, R2),
) (R0, R1, R2)

func DoR4

func DoR4[R0, R1, R2, R3 any](
	ctx context.Context,
	m Doer,
	fn func() (R0, R1, R2, R3),
) (R0, R1, R2, R3)

func IsEnableDeadlock

func IsEnableDeadlock(ctx context.Context) bool

func IsNoLogging

func IsNoLogging(ctx context.Context) bool

func RDoA1

func RDoA1[A0 any](
	ctx context.Context,
	m RDoer,
	fn func(A0),
	a0 A0,
)

func RDoA1R1

func RDoA1R1[A0, R0 any](
	ctx context.Context,
	m RDoer,
	fn func(A0) R0,
	a0 A0,
) R0

func RDoA1R2

func RDoA1R2[A0, R0, R1 any](
	ctx context.Context,
	m RDoer,
	fn func(A0) (R0, R1),
	a0 A0,
) (R0, R1)

func RDoA1R4

func RDoA1R4[A0, R0, R1, R2, R3 any](
	ctx context.Context,
	m RDoer,
	fn func(A0) (R0, R1, R2, R3),
	a0 A0,
) (R0, R1, R2, R3)

func RDoA2

func RDoA2[A0, A1 any](
	ctx context.Context,
	m RDoer,
	fn func(A0, A1),
	a0 A0,
	a1 A1,
)

func RDoA2R1

func RDoA2R1[A0, A1, R0 any](
	ctx context.Context,
	m RDoer,
	fn func(A0, A1) R0,
	a0 A0,
	a1 A1,
) R0

func RDoA2R2

func RDoA2R2[A0, A1, R0, R1 any](
	ctx context.Context,
	m RDoer,
	fn func(A0, A1) (R0, R1),
	a0 A0,
	a1 A1,
) (R0, R1)

func RDoA2R3

func RDoA2R3[A0, A1, R0, R1, R2 any](
	ctx context.Context,
	m RDoer,
	fn func(A0, A1) (R0, R1, R2),
	a0 A0,
	a1 A1,
) (R0, R1, R2)

func RDoA3R1

func RDoA3R1[A0, A1, A2, R0 any](
	ctx context.Context,
	m RDoer,
	fn func(A0, A1, A2) R0,
	a0 A0,
	a1 A1,
	a2 A2,
) R0

func RDoA4R1

func RDoA4R1[A0, A1, A2, A3, R0 any](
	ctx context.Context,
	m RDoer,
	fn func(A0, A1, A2, A3) R0,
	a0 A0,
	a1 A1,
	a2 A2,
	a3 A3,
) R0

func RDoR1

func RDoR1[R0 any](
	ctx context.Context,
	m RDoer,
	fn func() R0,
) R0

func RDoR2

func RDoR2[R0, R1 any](
	ctx context.Context,
	m RDoer,
	fn func() (R0, R1),
) (R0, R1)

func RDoR3

func RDoR3[R0, R1, R2 any](
	ctx context.Context,
	m RDoer,
	fn func() (R0, R1, R2),
) (R0, R1, R2)

func RDoR4

func RDoR4[R0, R1, R2, R3 any](
	ctx context.Context,
	m RDoer,
	fn func() (R0, R1, R2, R3),
) (R0, R1, R2, R3)

func WithEnableDeadlock

func WithEnableDeadlock(ctx context.Context, enableDeadlock bool) context.Context

func WithNoLogging

func WithNoLogging(ctx context.Context, noLogging bool) context.Context

Types

type CtxKeyEnableDeadlock

type CtxKeyEnableDeadlock struct{}

type CtxKeyNoLogging

type CtxKeyNoLogging struct{}

type Doer

type Doer interface {
	Do(context.Context, func())
}

type Gorex

type Gorex struct {
	gorex.Mutex
}

func (*Gorex) Do

func (g *Gorex) Do(ctx context.Context, callback func())

type Map

type Map[K comparable, V any] struct {
	sync.Map
}

func (*Map[K, V]) CompareAndDelete

func (m *Map[K, V]) CompareAndDelete(key K, old V) (deleted bool)

func (*Map[K, V]) CompareAndSwap

func (m *Map[K, V]) CompareAndSwap(key K, old, new V) (swapped bool)

func (*Map[K, V]) Delete

func (m *Map[K, V]) Delete(key K)

func (*Map[K, V]) Load

func (m *Map[K, V]) Load(key K) (V, bool)

func (*Map[K, V]) LoadAndDelete

func (m *Map[K, V]) LoadAndDelete(key K) (V, bool)

func (*Map[K, V]) LoadOrStore

func (m *Map[K, V]) LoadOrStore(key K, value V) (V, bool)

func (*Map[K, V]) Range

func (m *Map[K, V]) Range(f func(key K, value V) bool)

func (*Map[K, V]) Store

func (m *Map[K, V]) Store(key K, value V)

func (*Map[K, V]) Swap

func (m *Map[K, V]) Swap(key K, value V) (V, bool)

type Mutex

type Mutex = RWMutex

func (*Mutex) Do

func (m *Mutex) Do(
	ctx context.Context,
	fn func(),
)

func (*Mutex) ManualLock

func (m *Mutex) ManualLock(ctx context.Context)

func (*Mutex) ManualRLock

func (m *Mutex) ManualRLock(ctx context.Context)

func (*Mutex) ManualRUnlock

func (m *Mutex) ManualRUnlock(ctx context.Context)

func (*Mutex) ManualTryLock

func (m *Mutex) ManualTryLock(ctx context.Context) bool

func (*Mutex) ManualTryRLock

func (m *Mutex) ManualTryRLock(ctx context.Context) bool

func (*Mutex) ManualUnlock

func (m *Mutex) ManualUnlock(ctx context.Context)

func (*Mutex) RDo

func (m *Mutex) RDo(
	ctx context.Context,
	fn func(),
)

func (*Mutex) UDo

func (m *Mutex) UDo(
	ctx context.Context,
	fn func(),
)

func (*Mutex) URDo

func (m *Mutex) URDo(
	ctx context.Context,
	fn func(),
)

type RDoer

type RDoer interface {
	RDo(context.Context, func())
}

type RWMutex

type RWMutex struct {
	OverrideTimeout time.Duration
	PanicOnDeadlock *bool
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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